diff --git a/.conda/meta.yaml b/.conda/meta.yaml index fcac492132..7feb3a1bf9 100644 --- a/.conda/meta.yaml +++ b/.conda/meta.yaml @@ -20,7 +20,7 @@ requirements: - setuptools run: - - numpy >=1.16.0, <2.0.0 + - numpy >=1.16.0, <3.0.0 - scipy >=1.4.0, <2.0.0 - pillow >=9.2.0 - h5py >=3.1.0, <4.0.0 diff --git a/doctr/utils/metrics.py b/doctr/utils/metrics.py index faea10a3ab..6947298ede 100644 --- a/doctr/utils/metrics.py +++ b/doctr/utils/metrics.py @@ -149,7 +149,7 @@ def box_iou(boxes_1: np.ndarray, boxes_2: np.ndarray) -> np.ndarray: right = np.minimum(r1, r2.T) bot = np.minimum(b1, b2.T) - intersection = np.clip(right - left, 0, np.Inf) * np.clip(bot - top, 0, np.Inf) + intersection = np.clip(right - left, 0, np.inf) * np.clip(bot - top, 0, np.inf) union = (r1 - l1) * (b1 - t1) + ((r2 - l2) * (b2 - t2)).T - intersection iou_mat = intersection / union diff --git a/pyproject.toml b/pyproject.toml index c208d98652..82b277bd50 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,7 @@ dynamic = ["version"] dependencies = [ # For proper typing, mypy needs numpy>=1.20.0 (cf. https://github.com/numpy/numpy/pull/16515) # Additional typing support is brought by numpy>=1.22.4, but core build sticks to >=1.16.0 - "numpy>=1.16.0,<2.0.0", + "numpy>=1.16.0,<3.0.0", "scipy>=1.4.0,<2.0.0", "h5py>=3.1.0,<4.0.0", "opencv-python>=4.5.0,<5.0.0",