Skip to content

Commit f7f6816

Browse files
fkroeberpre-commit-ci[bot]Bordamergify[bot]
authored
fix max_det_threshold in MAP (#1712)
* fixed bug in max_det_threshold * chlog --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent 780e033 commit f7f6816

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
154154
- Fixed padding removal for 3d input in `MSSSIM` ([#1674](https://github.com/Lightning-AI/torchmetrics/pull/1674))
155155

156156

157+
- Fixed `max_det_threshold` in MAP detection ([#1712](https://github.com/Lightning-AI/torchmetrics/pull/1712))
158+
159+
157160
## [0.11.4] - 2023-03-10
158161

159162
### Fixed

src/torchmetrics/detection/mean_ap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -795,8 +795,8 @@ def _summarize_results(self, precisions: Tensor, recalls: Tensor) -> Tuple[MAPMe
795795
"""
796796
results = {"precision": precisions, "recall": recalls}
797797
map_metrics = MAPMetricResults()
798-
map_metrics.map = self._summarize(results, True)
799798
last_max_det_thr = self.max_detection_thresholds[-1]
799+
map_metrics.map = self._summarize(results, True, max_dets=last_max_det_thr)
800800
if 0.5 in self.iou_thresholds:
801801
map_metrics.map_50 = self._summarize(results, True, iou_threshold=0.5, max_dets=last_max_det_thr)
802802
else:

0 commit comments

Comments
 (0)