From e0db07a80fa6cfbbade4d572334766880ce42f8b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 5 Oct 2024 21:14:39 +0000 Subject: [PATCH] =?UTF-8?q?fix(pre=5Fcommit):=20=F0=9F=8E=A8=20auto=20form?= =?UTF-8?q?at=20pre-commit=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supervision/metrics/mean_average_precision.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/supervision/metrics/mean_average_precision.py b/supervision/metrics/mean_average_precision.py index 11fbef5a..ff2d9e8e 100644 --- a/supervision/metrics/mean_average_precision.py +++ b/supervision/metrics/mean_average_precision.py @@ -186,7 +186,9 @@ class MeanAveragePrecision(Metric): # Match detections: if class_agnostic is set, skip class matching if self._class_agnostic: - matches = self._match_detection_batch_class_agnostic(iou, iou_thresholds) + matches = self._match_detection_batch_class_agnostic( + iou, iou_thresholds + ) else: matches = self._match_detection_batch( predictions.class_id, targets.class_id, iou, iou_thresholds @@ -258,7 +260,6 @@ class MeanAveragePrecision(Metric): ) correct = np.zeros((num_predictions, num_iou_levels), dtype=bool) - correct_class = target_classes[:, None] == predictions_classes for i, iou_level in enumerate(iou_thresholds): @@ -277,6 +278,7 @@ class MeanAveragePrecision(Metric): correct[matches[:, 1].astype(int), i] = True return correct + @staticmethod def _match_detection_batch_class_agnostic( iou: np.ndarray, @@ -303,6 +305,7 @@ class MeanAveragePrecision(Metric): correct[matches[:, 1].astype(int), i] = True return correct + @staticmethod def _average_precisions_per_class( matches: np.ndarray,