From 865c4e42317f75e822dbe3b3abfd67eea3164b73 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 17:15:13 +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 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/supervision/metrics/mean_average_precision.py b/supervision/metrics/mean_average_precision.py index f0613f2b..0ebffd51 100644 --- a/supervision/metrics/mean_average_precision.py +++ b/supervision/metrics/mean_average_precision.py @@ -9,7 +9,11 @@ from matplotlib import pyplot as plt from supervision.config import ORIENTED_BOX_COORDINATES from supervision.detection.core import Detections -from supervision.detection.utils import box_iou_batch, mask_iou_batch, oriented_box_iou_batch +from supervision.detection.utils import ( + box_iou_batch, + mask_iou_batch, + oriented_box_iou_batch, +) from supervision.draw.color import LEGACY_COLOR_PALETTE from supervision.metrics.core import Metric, MetricTarget from supervision.metrics.utils.object_size import ( @@ -171,9 +175,13 @@ class MeanAveragePrecision(Metric): elif self._metric_target == MetricTarget.MASKS: iou = mask_iou_batch(target_contents, prediction_contents) elif self._metric_target == MetricTarget.ORIENTED_BOUNDING_BOXES: - iou = oriented_box_iou_batch(target_contents, prediction_contents) + iou = oriented_box_iou_batch( + target_contents, prediction_contents + ) else: - raise NotImplementedError("Unsupported metric target for IoU calculation") + raise NotImplementedError( + "Unsupported metric target for IoU calculation" + ) matches = self._match_detection_batch( predictions.class_id, targets.class_id, iou, iou_thresholds @@ -558,4 +566,4 @@ class MeanAveragePrecisionResult: plt.rcParams["font.family"] = "sans-serif" plt.tight_layout() - plt.show() \ No newline at end of file + plt.show()