Skip to content

Commit

Permalink
Fix int overflow in MAP (#1607)
Browse files Browse the repository at this point in the history
(cherry picked from commit ac59cdc)
  • Loading branch information
SkafteNicki authored and Borda committed Mar 10, 2023
1 parent 377d5dc commit d835b9f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,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
Original file line number Diff line number Diff line change
Expand Up @@ -388,10 +388,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

0 comments on commit d835b9f

Please sign in to comment.