diff --git a/docs/changelog.md b/docs/changelog.md index e7dbb18e..a572544c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,11 @@ # CHANGELOG +### 0.24.0 Oct 4, 2024 + +!!! failure "Removed" + The `frame_resolution_wh ` parameter in [`sv.PolygonZone`](https://supervision.roboflow.com/0.24.0/detection/tools/polygon_zone.md/#supervision.detection.tools.polygon_zone.PolygonZone) has been removed. + + ### 0.23.0 Aug 28, 2024 - Added [#930](https://github.com/roboflow/supervision/pull/930): `IconAnnotator`, a [new annotator](https://supervision.roboflow.com/0.23.0/detection/annotators/#supervision.annotators.core.IconAnnotator) that allows drawing icons on each detection. Useful if you want to draw a specific icon for each class. diff --git a/docs/deprecated.md b/docs/deprecated.md index bdd95a9d..fb70c8a6 100644 --- a/docs/deprecated.md +++ b/docs/deprecated.md @@ -7,8 +7,6 @@ status: deprecated These features are phased out due to better alternatives or potential issues in future versions. Deprecated functionalities are supported for **five subsequent releases**, providing time for users to transition to updated methods. -- The `frame_resolution_wh ` parameter in [`sv.PolygonZone`](detection/tools/polygon_zone.md/#supervision.detection.tools.polygon_zone.PolygonZone) will be removed in `supervision-0.24.0`. - - Constructing [`DetectionDataset`](https://supervision.roboflow.com/latest/datasets/core/#supervision.dataset.core.DetectionDataset) and [`ClassificationDataset`](https://supervision.roboflow.com/latest/datasets/core/#supervision.dataset.core.ClassificationDataset) with parameter `images` as `Dict[str, np.ndarray]` will be removed in `supervision-0.26.0`. Please pass a list of paths `List[str]` instead. - The `DetectionDataset.images` property will be removed in `supervision-0.26.0`. Please loop over images with `for path, image, annotation in dataset:`, as that does not require loading all images into memory. @@ -21,6 +19,10 @@ These features are phased out due to better alternatives or potential issues in # Removed +### 0.24.0 + +- The `frame_resolution_wh ` parameter in [`sv.PolygonZone`](detection/tools/polygon_zone.md/#supervision.detection.tools.polygon_zone.PolygonZone) has been removed. + ### 0.23.0 - The `track_buffer`, `track_thresh`, and `match_thresh` parameters in [`ByteTrack`](trackers.md/#supervision.tracker.byte_tracker.core.ByteTrack) are deprecated and were removed as of `supervision-0.23.0`. Use `lost_track_buffer,` `track_activation_threshold`, and `minimum_matching_threshold` instead. diff --git a/supervision/detection/tools/polygon_zone.py b/supervision/detection/tools/polygon_zone.py index af0d1c0c..ac7203ff 100644 --- a/supervision/detection/tools/polygon_zone.py +++ b/supervision/detection/tools/polygon_zone.py @@ -1,6 +1,5 @@ -import warnings from dataclasses import replace -from typing import Iterable, Optional, Tuple +from typing import Iterable, Optional import cv2 import numpy as np @@ -12,7 +11,6 @@ from supervision.draw.color import Color from supervision.draw.utils import draw_filled_polygon, draw_polygon, draw_text from supervision.geometry.core import Position from supervision.geometry.utils import get_polygon_center -from supervision.utils.internal import SupervisionWarnings class PolygonZone: @@ -33,17 +31,8 @@ class PolygonZone: def __init__( self, polygon: npt.NDArray[np.int64], - frame_resolution_wh: Optional[Tuple[int, int]] = None, triggering_anchors: Iterable[Position] = (Position.BOTTOM_CENTER,), ): - if frame_resolution_wh is not None: - warnings.warn( - "The `frame_resolution_wh` parameter is no longer required and will be " - "dropped in version supervision-0.24.0. The mask resolution is now " - "calculated automatically based on the polygon coordinates.", - category=SupervisionWarnings, - ) - self.polygon = polygon.astype(int) self.triggering_anchors = triggering_anchors if not list(self.triggering_anchors):