diff --git a/CHANGELOG.md b/CHANGELOG.md index 99f5c06e413..b74f8e97721 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/torchmetrics/detection/mean_ap.py b/src/torchmetrics/detection/mean_ap.py index ff9ace379f2..732342d6b69 100644 --- a/src/torchmetrics/detection/mean_ap.py +++ b/src/torchmetrics/detection/mean_ap.py @@ -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):