diff --git a/examples/count_people_in_zone/inference_example.py b/examples/count_people_in_zone/inference_example.py index e040a036..38018c16 100644 --- a/examples/count_people_in_zone/inference_example.py +++ b/examples/count_people_in_zone/inference_example.py @@ -35,9 +35,7 @@ def load_zones_config(file_path: str) -> List[np.ndarray]: def initiate_annotators( polygons: List[np.ndarray], resolution_wh: Tuple[int, int] -) -> Tuple[ - List[sv.PolygonZone], List[sv.PolygonZoneAnnotator], List[sv.BoxAnnotator] -]: +) -> Tuple[List[sv.PolygonZone], List[sv.PolygonZoneAnnotator], List[sv.BoxAnnotator]]: line_thickness = sv.calculate_optimal_line_thickness(resolution_wh=resolution_wh) text_scale = sv.calculate_optimal_text_scale(resolution_wh=resolution_wh) diff --git a/examples/count_people_in_zone/ultralytics_example.py b/examples/count_people_in_zone/ultralytics_example.py index f8d03fa4..04169597 100644 --- a/examples/count_people_in_zone/ultralytics_example.py +++ b/examples/count_people_in_zone/ultralytics_example.py @@ -33,9 +33,7 @@ def load_zones_config(file_path: str) -> List[np.ndarray]: def initiate_annotators( polygons: List[np.ndarray], resolution_wh: Tuple[int, int] -) -> Tuple[ - List[sv.PolygonZone], List[sv.PolygonZoneAnnotator], List[sv.BoxAnnotator] -]: +) -> Tuple[List[sv.PolygonZone], List[sv.PolygonZoneAnnotator], List[sv.BoxAnnotator]]: line_thickness = sv.calculate_optimal_line_thickness(resolution_wh=resolution_wh) text_scale = sv.calculate_optimal_text_scale(resolution_wh=resolution_wh) diff --git a/supervision/__init__.py b/supervision/__init__.py index 556e5d09..2366a83c 100644 --- a/supervision/__init__.py +++ b/supervision/__init__.py @@ -45,7 +45,6 @@ from supervision.detection.line_zone import ( LineZoneAnnotator, LineZoneAnnotatorMulticlass, ) -from supervision.detection.vlm import LMM, VLM from supervision.detection.overlap_filter import ( OverlapFilter, box_non_max_merge, @@ -78,6 +77,7 @@ from supervision.detection.utils import ( xywh_to_xyxy, xyxy_to_polygons, ) +from supervision.detection.vlm import LMM, VLM from supervision.draw.color import Color, ColorPalette from supervision.draw.utils import ( calculate_optimal_line_thickness, diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index 49ce45ec..4590ad96 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -36,7 +36,6 @@ from supervision.utils.image import ( overlay_image, scale_image, ) -from supervision.utils.internal import deprecated CV2_FONT = cv2.FONT_HERSHEY_SIMPLEX diff --git a/supervision/detection/core.py b/supervision/detection/core.py index f50c6190..81f0e75f 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -9,12 +9,6 @@ from supervision.config import ( CLASS_NAME_DATA_FIELD, ORIENTED_BOX_COORDINATES, ) -from supervision.detection.vlm import ( - LMM, - from_florence_2, - from_paligemma, - validate_vlm_parameters, VLM, -) from supervision.detection.overlap_filter import ( box_non_max_merge, box_non_max_suppression, @@ -38,8 +32,15 @@ from supervision.detection.utils import ( process_roboflow_result, xywh_to_xyxy, ) +from supervision.detection.vlm import ( + LMM, + VLM, + from_florence_2, + from_paligemma, + validate_vlm_parameters, +) from supervision.geometry.core import Position -from supervision.utils.internal import get_instance_variables, deprecated +from supervision.utils.internal import deprecated, get_instance_variables from supervision.validators import validate_detections_fields @@ -845,7 +846,7 @@ class Detections: lmm_to_vlm = { LMM.PALIGEMMA: VLM.PALIGEMMA, LMM.FLORENCE_2: VLM.FLORENCE_2, - LMM.QWEN_2_5_VL: VLM.QWEN_2_5_VL + LMM.QWEN_2_5_VL: VLM.QWEN_2_5_VL, } if isinstance(lmm, LMM): @@ -869,7 +870,9 @@ class Detections: return cls.from_vlm(vlm=vlm, result=result, **kwargs) @classmethod - def from_vlm(cls, vlm: Union[VLM, str], result: Union[str, dict], **kwargs: Any) -> Detections: + def from_vlm( + cls, vlm: Union[VLM, str], result: Union[str, dict], **kwargs: Any + ) -> Detections: vlm = validate_vlm_parameters(vlm, result, kwargs) if vlm == VLM.PALIGEMMA: