Skip to content

Commit

Permalink
Fix an inappropriate test expression to remove a logical short circuit (
Browse files Browse the repository at this point in the history
#2082)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
munahaf and mergify[bot] authored Sep 15, 2023
1 parent 9b21108 commit 77a5317
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/torchmetrics/detection/_mean_ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def _evaluate_image(
return self.__evaluate_image_gt_no_preds(gt, gt_label_mask, area_range, nb_iou_thrs)

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

gt = [gt[i] for i in gt_label_mask]
Expand Down

0 comments on commit 77a5317

Please sign in to comment.