Skip to content

Commit

Permalink
Fix int overflow in MAP (#1607)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkafteNicki committed Mar 10, 2023
1 parent 2d21f6f commit ac59cdc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
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

0 comments on commit ac59cdc

Please sign in to comment.