Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix max_det_threshold in MAP #1712

Merged
merged 7 commits into from
Apr 17, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/torchmetrics/detection/mean_ap.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,8 +795,8 @@ def _summarize_results(self, precisions: Tensor, recalls: Tensor) -> Tuple[MAPMe
"""
results = {"precision": precisions, "recall": recalls}
map_metrics = MAPMetricResults()
map_metrics.map = self._summarize(results, True)
last_max_det_thr = self.max_detection_thresholds[-1]
map_metrics.map = self._summarize(results, True, max_dets=last_max_det_thr)
if 0.5 in self.iou_thresholds:
map_metrics.map_50 = self._summarize(results, True, iou_threshold=0.5, max_dets=last_max_det_thr)
else:
Expand Down