Skip to content

Commit 477c73b

Browse files
committed
remove NDArray
1 parent 8b691b2 commit 477c73b

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

deeptrack/features.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@
156156

157157
import array_api_compat as apc
158158
import numpy as np
159-
from numpy.typing import NDArray
160159
import matplotlib.pyplot as plt
161160
from matplotlib import animation
162161
from pint import Quantity
@@ -388,8 +387,8 @@ class Feature(DeepTrackNode):
388387
It binds another feature’s properties as arguments to this feature.
389388
`plot(
390389
input_image: (
391-
NDArray
392-
| list[NDArray]
390+
np.ndarray
391+
| list[np.ndarray]
393392
| torch.Tensor
394393
| list[torch.Tensor]
395394
| Image
@@ -1766,12 +1765,10 @@ def bind_arguments(
17661765
def plot(
17671766
self: Feature,
17681767
input_image: (
1769-
NDArray
1770-
| list[NDArray]
1768+
np.ndarray
1769+
| list[np.ndarray]
17711770
| torch.Tensor
17721771
| list[torch.Tensor]
1773-
| Image
1774-
| list[Image]
17751772
) = None,
17761773
resolve_kwargs: dict = None,
17771774
interval: float = None,
@@ -7363,7 +7360,7 @@ class LoadImage(Feature):
73637360
73647361
Methods
73657362
-------
7366-
`get(...) -> NDArray | list[NDArray] | torch.Tensor | list[torch.Tensor]`
7363+
`get(...) -> array or tensor or list of arrays/tensors`
73677364
Load the image(s) from disk and process them.
73687365
73697366
Raises
@@ -7493,7 +7490,7 @@ def get(
74937490
as_list: bool,
74947491
get_one_random: bool,
74957492
**kwargs: Any,
7496-
) -> NDArray[Any] | torch.Tensor | list[NDArray[Any] | torch.Tensor]:
7493+
) -> np.ndarray | torch.Tensor | list[np.ndarray | torch.Tensor]:
74977494
"""Load and process an image or a list of images from disk.
74987495
74997496
This method attempts to load an image using multiple file readers
@@ -7983,10 +7980,10 @@ def __init__(
79837980

79847981
def get(
79857982
self: Feature,
7986-
image: NDArray | torch.Tensor,
7983+
image: np.ndarray | torch.Tensor,
79877984
dtype: str,
79887985
**kwargs: Any,
7989-
) -> NDArray | torch.Tensor:
7986+
) -> np.ndarray | torch.Tensor:
79907987
"""Convert the data type of the input image.
79917988
79927989
Parameters
@@ -8122,10 +8119,10 @@ def __init__(
81228119

81238120
def get(
81248121
self: Feature,
8125-
image: NDArray | torch.Tensor,
8122+
image: np.ndarray | torch.Tensor,
81268123
axis: int = -1,
81278124
**kwargs: Any,
8128-
) -> NDArray | torch.Tensor:
8125+
) -> np.ndarray | torch.Tensor:
81298126
"""Rearrange the axes of an image to channel-first format.
81308127
81318128
Rearrange the axes of a 3D image to channel-first format or add a

0 commit comments

Comments
 (0)