Skip to content

Commit 3bd4316

Browse files
authored
Merge pull request #287 from MichaelMonashev/patch-4
fix numpy 1.24 errors
2 parents faadf03 + 595bf07 commit 3bd4316

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

effdet/evaluation/metrics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def compute_precision_recall(scores, labels, num_gt):
1818
if not isinstance(labels, np.ndarray) or len(labels.shape) != 1:
1919
raise ValueError("labels must be single dimension numpy array")
2020

21-
if labels.dtype != np.float and labels.dtype != np.bool:
21+
if labels.dtype != np.float_ and labels.dtype != np.bool_:
2222
raise ValueError("labels type must be either bool or float")
2323

2424
if not isinstance(scores, np.ndarray) or len(scores.shape) != 1:
@@ -64,7 +64,7 @@ def compute_average_precision(precision, recall):
6464

6565
if not isinstance(precision, np.ndarray) or not isinstance(recall, np.ndarray):
6666
raise ValueError("precision and recall must be numpy array")
67-
if precision.dtype != np.float or recall.dtype != np.float:
67+
if precision.dtype != np.float_ or recall.dtype != np.float_:
6868
raise ValueError("input must be float numpy array.")
6969
if len(precision) != len(recall):
7070
raise ValueError("precision and recall must be of the same size.")

0 commit comments

Comments
 (0)