Skip to content

Commit

Permalink
updates to support numpy2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
felixdittrich92 committed Aug 29, 2024
1 parent 9045dcf commit 0d84464
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion doctr/utils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 0d84464

Please sign in to comment.