Skip to content

Commit

Permalink
Minor fix: mAP can be 1.01
Browse files Browse the repository at this point in the history
Fix division to avoid cases where 1.01 mAP is possible.

Discovered in: https://colab.research.google.com/drive/10EaQ4lJNXzcmub7doO2vGn2t1LgDdkcC?usp=sharing
  • Loading branch information
LinasKo authored Oct 9, 2024
1 parent 22d7358 commit 3231f7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion supervision/metrics/mean_average_precision.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def _compute_average_precision(recall: np.ndarray, precision: np.ndarray) -> flo
for r, p in zip(recall[::-1], precision[::-1]):
precision_levels[recall_levels <= r] = p

average_precision = (1 / 100 * precision_levels).sum()
average_precision = (1 / 101 * precision_levels).sum()
return average_precision

@staticmethod
Expand Down

0 comments on commit 3231f7f

Please sign in to comment.