Skip to content

Commit 77a5317

Browse files
Fix an inappropriate test expression to remove a logical short circuit (#2082)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 9b21108 commit 77a5317

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/torchmetrics/detection/_mean_ap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ def _evaluate_image(
542542
return self.__evaluate_image_gt_no_preds(gt, gt_label_mask, area_range, nb_iou_thrs)
543543

544544
# Some predictions but no GT
545-
if len(gt_label_mask) == 0 and len(det_label_mask) >= 0:
545+
if len(gt_label_mask) == 0 and len(det_label_mask) > 0:
546546
return self.__evaluate_image_preds_no_gt(det, idx, det_label_mask, max_det, area_range, nb_iou_thrs)
547547

548548
gt = [gt[i] for i in gt_label_mask]

0 commit comments

Comments
 (0)