From cb220479ebaf63464f758550b58e7eb321ed0f87 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 13 Apr 2024 13:16: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/annotators/core.py | 4 ++-- supervision/annotators/utils.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index baf04574..4a8d0b66 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -3,7 +3,7 @@ from typing import List, Optional, Tuple, Union import cv2 import numpy as np -from PIL import ImageFont, ImageDraw, Image +from PIL import Image, ImageDraw, ImageFont from supervision.annotators.base import BaseAnnotator, ImageType from supervision.annotators.utils import ( @@ -1104,7 +1104,6 @@ class LabelAnnotator: class RichLabelAnnotator: - def __init__( self, color: Union[Color, ColorPalette] = ColorPalette.DEFAULT, @@ -1202,6 +1201,7 @@ class RichLabelAnnotator: return scene + class BlurAnnotator(BaseAnnotator): """ A class for blurring regions in an image using provided detections. diff --git a/supervision/annotators/utils.py b/supervision/annotators/utils.py index bdc17975..f0de9fa5 100644 --- a/supervision/annotators/utils.py +++ b/supervision/annotators/utils.py @@ -1,5 +1,5 @@ from enum import Enum -from typing import Optional, Union, Tuple +from typing import Optional, Tuple, Union import numpy as np @@ -62,6 +62,7 @@ def resolve_color_idx( ) return detections.tracker_id[detection_idx] + def resolve_text_background_xyxy( center_coordinates: Tuple[int, int], text_wh: Tuple[int, int],