From 8d7f18cc2284fbcb40ef8517add881ba8ddb76e1 Mon Sep 17 00:00:00 2001 From: SkalskiP Date: Fri, 15 Mar 2024 10:48:01 +0100 Subject: [PATCH] `supervision-0.19.0` release changelog --- docs/annotators.md | 6 --- docs/changelog.md | 84 +++++++++++++++++++++++++++++++++- supervision/annotators/core.py | 1 + 3 files changed, 84 insertions(+), 7 deletions(-) diff --git a/docs/annotators.md b/docs/annotators.md index 168028ee..dde7cebb 100644 --- a/docs/annotators.md +++ b/docs/annotators.md @@ -293,12 +293,6 @@ status: new ) ``` -
- - ![label-annotator-example](https://media.roboflow.com/supervision-annotator-examples/label-annotator-example-purple.png){ align=center width="800" } - -
- === "Blur" ```python diff --git a/docs/changelog.md b/docs/changelog.md index 103766ad..2c5d7ae1 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,6 +1,88 @@ +### 0.19.0 March 15, 2024 + +- Added [#818](https://github.com/roboflow/supervision/pull/818): [`sv.CSVSink`](/0.19.0/detection/tools/save_detections/#supervision.detection.tools.csv_sink.CSVSink) allowing for the straightforward saving of image, video, or stream inference results in a `.csv` file. + +```python +import supervision as sv +from ultralytics import YOLO + +model = YOLO() +csv_sink = sv.CSVSink() +frames_generator = sv.get_video_frames_generator() + +with csv_sink: + for frame in frames_generator: + result = model(frame)[0] + detections = sv.Detections.from_ultralytics(result) + csv_sink.append(detections, custom_data={:}) +``` + +- Added [#819](https://github.com/roboflow/supervision/pull/819): [`sv.JSONSink`](/0.19.0/detection/tools/save_detections/#supervision.detection.tools.csv_sink.JSONSink) allowing for the straightforward saving of image, video, or stream inference results in a `.json` file. + +```python + +```python +import supervision as sv +from ultralytics import YOLO + +model = YOLO() +json_sink = sv.JSONSink() +frames_generator = sv.get_video_frames_generator() + +with json_sink: + for frame in frames_generator: + result = model(frame)[0] + detections = sv.Detections.from_ultralytics(result) + json_sink.append(detections, custom_data={:}) +``` + +- Added [#847](https://github.com/roboflow/supervision/pull/847): [`sv.mask_iou_batch`](/0.19.0/detection/utils/#supervision.detection.utils.mask_iou_batch) allowing to compute Intersection over Union (IoU) of two sets of masks. + +- Added [#847](https://github.com/roboflow/supervision/pull/847): [`sv.mask_non_max_suppression`](/0.19.0/detection/utils/#supervision.detection.utils.mask_non_max_suppression) allowing to perform Non-Maximum Suppression (NMS) on segmentation predictions. + +- Added [#888](https://github.com/roboflow/supervision/pull/888): [`sv.CropAnnotator`](/0.19.0/annotators/#supervision.annotators.core.CropAnnotator) allowing users to annotate the scene with scaled-up crops of detections. + +```python +import cv2 +import supervision as sv +from inference import get_model + +image = cv2.imread() +model = get_model(model_id="yolov8n-640") + +result = model.infer(image)[0] +detections = sv.Detections.from_inference(result) + +crop_annotator = sv.CropAnnotator() +annotated_frame = crop_annotator.annotate( + scene=image.copy(), + detections=detections +) +``` + +- Changed [#827](https://github.com/roboflow/supervision/pull/827): [`sv.ByteTrack.reset`](/0.19.0/tracking/#supervision.tracking.ByteTrack.reset) allowing users to clear trackers state, enabling the processing of multiple video files in sequence. + +- Changed [#802](https://github.com/roboflow/supervision/pull/802): [`sv.LineZoneAnnotator`](/0.19.0/detection/tools/line_zone/#supervision.detection.line_zone.LineZone) allowing to hide in/out count using `display_in_count` and `display_out_count` properties. + +- Changed [#787](https://github.com/roboflow/supervision/pull/787): [`sv.ByteTrack`](/0.19.0/tracking/#supervision.tracking.ByteTrack) input arguments and docstrings updated to improve readability and ease of use. + +!!! failure "Deprecated" + + The `track_buffer`, `track_thresh`, and `match_thresh` parameters in `sv.ByterTrack` are deprecated and will be removed in `supervision-0.23.0`. Use `lost_track_buffer,` `track_activation_threshold`, and `minimum_matching_threshold` instead. + +- Changed [#910](https://github.com/roboflow/supervision/pull/910): [`sv.PolygonZone`](/0.19.0/detection/tools/polygon_zone/#supervision.detection.tools.polygon_zone.PolygonZone) to now accept a list of specific box anchors that must be in zone for a detection to be counted. + +!!! failure "Deprecated" + + The `triggering_position ` parameter in `sv.PolygonZone` is deprecated and will be removed in `supervision-0.23.0`. Use `triggering_anchors` instead. + +- Changed [#875](https://github.com/roboflow/supervision/pull/875): annotators adding support for Pillow images. All supervision Annotators can now accept an image as either a numpy array or a Pillow Image. They automatically detect its type, draw annotations, and return the output in the same format as the input. + +- Fixed [#944](https://github.com/roboflow/supervision/pull/944): [`sv.DetectionsSmoother`](/0.19.0/detection/tools/smoother/#supervision.detection.tools.smoother.DetectionsSmoother) removing `tracking_id` from `sv.Detections`. + ### 0.18.0 January 25, 2024 -- Added [#633](https://github.com/roboflow/supervision/pull/720): [`sv.PercentageBarAnnotator`](/0.18.0/annotators/#percentagebarannotator) allowing to annotate images and videos with percentage values representing confidence or other custom property. +- Added [#720](https://github.com/roboflow/supervision/pull/720): [`sv.PercentageBarAnnotator`](/0.18.0/annotators/#percentagebarannotator) allowing to annotate images and videos with percentage values representing confidence or other custom property. ```python >>> import supervision as sv diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index fc956722..0c834fa8 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -1859,6 +1859,7 @@ class CropAnnotator(BaseAnnotator): self.position: Position = position self.scale_factor: int = scale_factor + @scene_to_annotator_img_type def annotate( self, scene: np.ndarray,