From a135bd6268360e2eb65eba69d9bec775e44b8ba3 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Tue, 15 Jul 2025 21:12:50 +0200 Subject: [PATCH] add deprecation message to old mAP --- supervision/metrics/detection.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/supervision/metrics/detection.py b/supervision/metrics/detection.py index 438b6a80..52bf96e0 100644 --- a/supervision/metrics/detection.py +++ b/supervision/metrics/detection.py @@ -10,6 +10,7 @@ import numpy as np from supervision.dataset.core import DetectionDataset from supervision.detection.core import Detections from supervision.detection.utils.iou_and_nms import box_iou_batch +from supervision.utils.internal import deprecated def detections_to_tensor( @@ -492,10 +493,23 @@ class ConfusionMatrix: ) return fig - +@deprecated( + "`MeanAveragePrecision` is deprecated and will be removed in " + "`supervision-0.31.0`. Use " + "`supervision.metrics.mean_average_precision.MeanAveragePrecision` instead." +) @dataclass(frozen=True) class MeanAveragePrecision: """ + !!! deprecated "Deprecated" + `MeanAveragePrecision` is **deprecated** and will be removed in + `supervision-0.31.0`. + + The current implementation provides results that are inconsistent with + `pycocotools`. Please use + `supervision.metrics.mean_average_precision.MeanAveragePrecision` instead, + which matches the results of `pycocotools` and is now the recommended approach. + Mean Average Precision for object detection tasks. Attributes: