Skip to content

Commit b01b321

Browse files
authored
Merge pull request #1572 from roboflow/feat/changelog-0.24.0
Feat/changelog 0.24.0
2 parents 72d0b9b + c9dfdbe commit b01b321

File tree

10 files changed

+188
-19
lines changed

10 files changed

+188
-19
lines changed

docs/changelog.md

Lines changed: 165 additions & 1 deletion
Large diffs are not rendered by default.

docs/deprecated.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ status: deprecated
77

88
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.
99

10-
- 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`.
11-
1210
- 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.
1311

1412
- 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,10 +19,15 @@ These features are phased out due to better alternatives or potential issues in
2119

2220
# Removed
2321

22+
### 0.24.0
23+
24+
- The `frame_resolution_wh ` parameter in [`sv.PolygonZone`](detection/tools/polygon_zone.md/#supervision.detection.tools.polygon_zone.PolygonZone) has been removed.
25+
- Supervision installation methods `"headless"` and `"desktop"` were removed, as they are no longer needed. `pip install supervision[headless]` will install the base library and harmlessly warn of non-existent extras.
26+
2427
### 0.23.0
2528

2629
- 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.
27-
- The `triggering_position ` parameter in [`sv.PolygonZone`](detection/tools/polygon_zone.md/#supervision.detection.tools.polygon_zone.PolygonZone) was removed as of `supervision-0.23.0`. Use `triggering_anchors ` instead.
30+
- The `triggering_position ` parameter in [`sv.PolygonZone`](detection/tools/polygon_zone.md/#supervision.detection.tools.polygon_zone.PolygonZone) was removed as of `supervision-0.23.0`. Use `triggering_anchors` instead.
2831

2932
### 0.22.0
3033

docs/detection/tools/line_zone.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
comments: true
3+
status: new
34
---
45

56
<div class="md-typeset">

docs/detection/tools/polygon_zone.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
comments: true
3+
status: new
34
---
45

56
<div class="md-typeset">

docs/detection/utils.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
22
comments: true
3+
status: new
34
---
45

56
# Detection Utils

docs/keypoint/annotators.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
comments: true
3-
status: new
43
---
54

65
# Annotators

docs/utils/image.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
comments: true
3-
status: new
43
---
54

65
# Image Utils

docs/utils/video.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
comments: true
3-
status: new
43
---
54

65
# Video Utils

supervision/detection/line_zone.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,19 @@ def annotate(
696696
line_zones: List[LineZone],
697697
line_zone_labels: Optional[List[str]] = None,
698698
) -> np.ndarray:
699+
"""
700+
Draws a table with the number of objects of each class that crossed each line.
701+
702+
Attributes:
703+
frame (np.ndarray): The image on which the table will be drawn.
704+
line_zones (List[LineZone]): The line zones to be annotated.
705+
line_zone_labels (Optional[List[str]]): The labels, one for each
706+
line zone. If not provided, the default labels will be used.
707+
708+
Returns:
709+
(np.ndarray): The image with the table drawn on it.
710+
711+
"""
699712
if line_zone_labels is None:
700713
line_zone_labels = [f"Line {i + 1}:" for i in range(len(line_zones))]
701714
if len(line_zones) != len(line_zone_labels):

supervision/detection/tools/polygon_zone.py

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import warnings
21
from dataclasses import replace
3-
from typing import Iterable, Optional, Tuple
2+
from typing import Iterable, Optional
43

54
import cv2
65
import numpy as np
@@ -12,7 +11,6 @@
1211
from supervision.draw.utils import draw_filled_polygon, draw_polygon, draw_text
1312
from supervision.geometry.core import Position
1413
from supervision.geometry.utils import get_polygon_center
15-
from supervision.utils.internal import SupervisionWarnings
1614

1715

1816
class PolygonZone:
@@ -33,17 +31,8 @@ class PolygonZone:
3331
def __init__(
3432
self,
3533
polygon: npt.NDArray[np.int64],
36-
frame_resolution_wh: Optional[Tuple[int, int]] = None,
3734
triggering_anchors: Iterable[Position] = (Position.BOTTOM_CENTER,),
3835
):
39-
if frame_resolution_wh is not None:
40-
warnings.warn(
41-
"The `frame_resolution_wh` parameter is no longer required and will be "
42-
"dropped in version supervision-0.24.0. The mask resolution is now "
43-
"calculated automatically based on the polygon coordinates.",
44-
category=SupervisionWarnings,
45-
)
46-
4736
self.polygon = polygon.astype(int)
4837
self.triggering_anchors = triggering_anchors
4938
if not list(self.triggering_anchors):

0 commit comments

Comments
 (0)