From d6589443d72124fb835853ebbcf1e7fa4d8091c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 13:13:08 +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/annotators/core.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 8e889cd3..17d1595c 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -12,7 +12,7 @@ from supervision.detection.utils import clip_boxes, mask_to_polygons from supervision.draw.color import Color, ColorPalette from supervision.draw.utils import draw_polygon from supervision.geometry.core import Position -from supervision.utils.image import crop_image, resize_image, place_image +from supervision.utils.image import crop_image, place_image, resize_image class BoundingBoxAnnotator(BaseAnnotator): @@ -1796,23 +1796,17 @@ class CropAnnotator(BaseAnnotator): ``` """ crops = [ - crop_image(image=scene, xyxy=xyxy) - for xyxy - in detections.xyxy.astype(int) + crop_image(image=scene, xyxy=xyxy) for xyxy in detections.xyxy.astype(int) ] resized_crops = [ - resize_image(image=crop, scale_factor=self.scale_factor) - for crop - in crops + resize_image(image=crop, scale_factor=self.scale_factor) for crop in crops ] anchors = detections.get_anchors_coordinates(anchor=self.position).astype(int) for resized_crop, anchor in zip(resized_crops, anchors): crop_wh = resized_crop.shape[1], resized_crop.shape[0] crop_anchor = self.calculate_crop_coordinates( - anchor=anchor, - crop_wh=crop_wh, - position=self.position + anchor=anchor, crop_wh=crop_wh, position=self.position ) scene = place_image(scene=scene, image=resized_crop, anchor=crop_anchor)