From 0ba57b2f57fafb76d343820e2c0bb7914ca7c86d Mon Sep 17 00:00:00 2001 From: jirka <6035284+Borda@users.noreply.github.com> Date: Tue, 27 Jan 2026 16:46:49 +0100 Subject: [PATCH] Update deprecation annotations and refactor `deprecated` utility usage --- supervision/detection/core.py | 1 + supervision/detection/utils/boxes.py | 1 + supervision/detection/vlm.py | 1 + supervision/metrics/detection.py | 1 + supervision/utils/image.py | 4 +++- 5 files changed, 7 insertions(+), 1 deletion(-) diff --git a/supervision/detection/core.py b/supervision/detection/core.py index 5d65238d..37642632 100644 --- a/supervision/detection/core.py +++ b/supervision/detection/core.py @@ -819,6 +819,7 @@ class Detections: @classmethod @deprecated( + target=None, deprecated_in="0.27.0", remove_in="0.31.0", ) diff --git a/supervision/detection/utils/boxes.py b/supervision/detection/utils/boxes.py index ef577585..e9b848c9 100644 --- a/supervision/detection/utils/boxes.py +++ b/supervision/detection/utils/boxes.py @@ -96,6 +96,7 @@ def pad_boxes(xyxy: np.ndarray, px: int, py: int | None = None) -> np.ndarray: @deprecated( + target=None, deprecated_in="0.27.0", remove_in="0.30.0", args_mapping={"normalized_xyxy": "xyxy"}, diff --git a/supervision/detection/vlm.py b/supervision/detection/vlm.py index ce4fc277..a8bbd9d2 100644 --- a/supervision/detection/vlm.py +++ b/supervision/detection/vlm.py @@ -18,6 +18,7 @@ from supervision.validators import validate_resolution @deprecated( + target=None, deprecated_in="0.27.0", remove_in="0.31.0", ) diff --git a/supervision/metrics/detection.py b/supervision/metrics/detection.py index 452d6a8a..14f4b04c 100644 --- a/supervision/metrics/detection.py +++ b/supervision/metrics/detection.py @@ -495,6 +495,7 @@ class ConfusionMatrix: @deprecated( + target=None, deprecated_in="0.27.0", remove_in="0.31.0", ) diff --git a/supervision/utils/image.py b/supervision/utils/image.py index f3cc7a96..22da02fa 100644 --- a/supervision/utils/image.py +++ b/supervision/utils/image.py @@ -8,10 +8,10 @@ import cv2 import numpy as np import numpy.typing as npt from PIL import Image +from supervision.geometry.core import Point from typing_extensions import Literal from deprecate import deprecated -from supervision import Point from supervision.annotators.base import ImageType from supervision.draw.color import Color, unify_to_bgr from supervision.utils.conversion import ( @@ -287,6 +287,7 @@ def letterbox_image( @deprecated( + target=None, deprecated_in="0.27.0", remove_in="0.32.0", ) @@ -633,6 +634,7 @@ class ImageSink: @deprecated( + target=None, deprecated_in="0.27.0", remove_in="0.27.0", )