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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix int overflow in MAP #1607

Merged
merged 3 commits into from Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -115,6 +115,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fixed corner case for `PearsonCorrCoef` when running in ddp mode but only on single device ([#1587](https://github.com/Lightning-AI/metrics/pull/1587))


- Fixed overflow error for specific cases in `MAP` when big areas are calculated ([#1607](https://github.com/Lightning-AI/metrics/pull/1607))


## [0.11.2] - 2023-02-21

### Fixed
Expand Down
8 changes: 4 additions & 4 deletions src/torchmetrics/detection/mean_ap.py
Expand Up @@ -392,10 +392,10 @@ def __init__(
raise ModuleNotFoundError("When `iou_type` is set to 'segm', pycocotools need to be installed")
self.iou_type = iou_type
self.bbox_area_ranges = {
"all": (0**2, int(1e5**2)),
"small": (0**2, 32**2),
"medium": (32**2, 96**2),
"large": (96**2, int(1e5**2)),
"all": (float(0**2), float(1e5**2)),
"small": (float(0**2), float(32**2)),
"medium": (float(32**2), float(96**2)),
"large": (float(96**2), float(1e5**2)),
}

if not isinstance(class_metrics, bool):
Expand Down