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: