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],