Supervision

Latest version: v0.21.0

Safety actively analyzes 638466 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 5

0.11.1

🛠️ Fixed

- [`as_folder_structure`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.ClassificationDataset.as_folder_structure) fails to save [`sv.ClassificationDataset`](https://roboflow.github.io/supervision/dataset/core/#classificationdataset) when it is result of inference. (https://github.com/roboflow/supervision/pull/165)

🏆 Contributors

capjamesg SkalskiP

0.11.0

🚀 Added

- Ability to load and save [`sv.DetectionDataset`](https://roboflow.github.io/supervision/dataset/core/#detectiondataset) in COCO format using [`as_coco`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.as_coco) and [`from_coco`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.from_coco) methods. (https://github.com/roboflow/supervision/pull/150)

python
>>> import supervision as sv

>>> ds = sv.DetectionDataset.from_coco(
... images_directory_path='...',
... annotations_path='...'
... )

>>> ds.as_coco(
... images_directory_path='...',
... annotations_path='...'
... )


- Ability to marge multiple [`sv.DetectionDataset`](https://roboflow.github.io/supervision/dataset/core/#detectiondataset) together using [`merge`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.merge) method. (https://github.com/roboflow/supervision/pull/158)

python
>>> import supervision as sv

>>> ds_1 = sv.DetectionDataset(...)
>>> len(ds_1)
100
>>> ds_1.classes
['dog', 'person']

>>> ds_2 = sv.DetectionDataset(...)
>>> len(ds_2)
200
>>> ds_2.classes
['cat']

>>> ds_merged = sv.DetectionDataset.merge([ds_1, ds_2])
>>> len(ds_merged)
300
>>> ds_merged.classes
['cat', 'dog', 'person']


![Snap (47)](https://github.com/roboflow/supervision/assets/26109316/bac30d91-3542-44a8-b007-62f7040c0aab)

- Additional `start` and `end` arguments to [`sv.get_video_frames_generator`](https://roboflow.github.io/supervision/utils/video/#get_video_frames_generator) allowing to generate frames only for a selected part of the video. (https://github.com/roboflow/supervision/pull/162)

🛠️ Fixed

- Incorrect loading of YOLO dataset class names from `data.yaml`. (https://github.com/roboflow/supervision/pull/157)

🏆 Contributors

SkalskiP hardikdava

0.10.0

🚀 Added

- Ability to load and save [`sv.ClassificationDataset`](https://roboflow.github.io/supervision/dataset/core/#classificationdataset) in a folder structure format. (https://github.com/roboflow/supervision/pull/125)

python
>>> import supervision as sv

>>> cs = sv.ClassificationDataset.from_folder_structure(
... root_directory_path='...'
... )

>>> cs.as_folder_structure(
... root_directory_path='...'
... )


- Support for [`sv.ClassificationDataset.split`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.ClassificationDataset.split) allowing to divide `sv.ClassificationDataset` into two parts. (https://github.com/roboflow/supervision/pull/125)

python
>>> import supervision as sv

>>> cs = sv.ClassificationDataset(...)
>>> train_cs, test_cs = cs.split(split_ratio=0.7, random_state=42, shuffle=True)

>>> len(train_cs), len(test_cs)
(700, 300)


- Ability to extract masks from Roboflow API results using [`sv.Detections.from_roboflow`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.from_roboflow). (https://github.com/roboflow/supervision/pull/110)

- Supervision Quickstart [notebook](https://colab.research.google.com/github/roboflow/supervision/blob/main/demo.ipynb) where you can learn more about Detection, Dataset and Video APIs.

![Screenshot 2023-06-14 at 15 33 27](https://github.com/roboflow/supervision/assets/26109316/4975fa3f-7b26-462c-b318-7db7a39c620f)


🌱 Changed

- `sv.get_video_frames_generator` documentation to better describe actual behavior. (https://github.com/roboflow/supervision/pull/135)

![Snap (45)](https://github.com/roboflow/supervision/assets/26109316/ef873410-5ad7-4a21-810c-e413437a5b08)

🏆 Contributors

capjamesg dankresio SkalskiP

0.9.0

🚀 Added

- Ability to select [`sv.Detections`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.__getitem__) by index, list of indexes or slice. Here is an example illustrating the new selection methods. (https://github.com/roboflow/supervision/pull/118)

python
>>> import supervision as sv

>>> detections = sv.Detections(...)
>>> len(detections[0])
1
>>> len(detections[[0, 1]])
2
>>> len(detections[0:2])
2


![supervision-0_9_0-Snap (4)](https://github.com/roboflow/supervision/assets/26109316/cdf1ef7e-50c6-494f-9cf1-5c054f00333f)

- Ability to extract masks from YOLOv8 results using [`sv.Detections.from_yolov8`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.from_yolov8). Here is an example illustrating how to extract boolean masks from the result of the YOLOv8 model inference. (https://github.com/roboflow/supervision/pull/101)

python
>>> import cv2
>>> from ultralytics import YOLO
>>> import supervision as sv

>>> image = cv2.imread(...)
>>> image.shape
(640, 640, 3)

>>> model = YOLO('yolov8s-seg.pt')
>>> result = model(image)[0]
>>> detections = sv.Detections.from_yolov8(result)
>>> detections.mask.shape
(2, 640, 640)


- Ability to crop the image using [`sv.crop`](https://roboflow.github.io/supervision/utils/image/#crop). Here is an example showing how to get a separate crop for each detection in `sv.Detections`. (https://github.com/roboflow/supervision/pull/122)

python
>>> import cv2
>>> import supervision as sv

>>> image = cv2.imread(...)
>>> detections = sv.Detections(...)
>>> len(detections)
2
>>> crops = [
... sv.crop(image=image, xyxy=xyxy)
... for xyxy
... in detections.xyxy
... ]
>>> len(crops)
2


- Ability to conveniently save multiple images into directory using [`sv.ImageSink`](https://roboflow.github.io/supervision/utils/image/#imagesink). An example shows how to save every tenth video frame as a separate image. (https://github.com/roboflow/supervision/pull/120)

python
>>> import supervision as sv

>>> with sv.ImageSink(target_dir_path='target/directory/path') as sink:
... for image in sv.get_video_frames_generator(source_path='source_video.mp4', stride=10):
... sink.save_image(image=image)


🛠️ Fixed

- Inconvenient handling of [`sv.PolygonZone`](https://roboflow.github.io/supervision/detection/tools/polygon_zone/#polygonzone) coordinates. Now `sv.PolygonZone` accepts coordinates in the form of `[[x1, y1], [x2, y2], ...]` that can be both integers and floats. (https://github.com/roboflow/supervision/issues/106)

🏆 Contributors

SkalskiP lomnes-atlast-food hardikdava

0.8.0

🚀 Added

- Support for dataset inheritance. The current `Dataset` got renamed to `DetectionDataset`. Now [`DetectionDataset`](https://roboflow.github.io/supervision/dataset/core/#detectiondataset) inherits from `BaseDataset`. This change was made to enforce the future consistency of APIs of different types of computer vision datasets. (https://github.com/roboflow/supervision/pull/100)
- Ability to save datasets in YOLO format using [`DetectionDataset.as_yolo`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.as_yolo). (https://github.com/roboflow/supervision/pull/100)

python
>>> import supervision as sv

>>> ds = sv.DetectionDataset(...)
>>> ds.as_yolo(
... images_directory_path='...',
... annotations_directory_path='...',
... data_yaml_path='...'
... )


- Support for [`DetectionDataset.split`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.split) allowing to divide `DetectionDataset` into two parts. (https://github.com/roboflow/supervision/pull/102)

python
>>> import supervision as sv

>>> ds = sv.DetectionDataset(...)
>>> train_ds, test_ds = ds.split(split_ratio=0.7, random_state=42, shuffle=True)

>>> len(train_ds), len(test_ds)
(700, 300)


🌱 Changed

- Default value of `approximation_percentage` parameter from `0.75` to `0.0` in `DetectionDataset.as_yolo` and `DetectionDataset.as_pascal_voc`. (https://github.com/roboflow/supervision/pull/100)

![1](https://github.com/roboflow/supervision/assets/26109316/43027199-c098-45b0-aee9-c6542d3a6a74)

🏆 Contributors

- SkalskiP

0.7.0

🚀 Added

- `Detections.from_yolo_nas` to enable seamless integration with [YOLO-NAS](https://github.com/Deci-AI/super-gradients/blob/master/YOLONAS.md) model. (https://github.com/roboflow/supervision/pull/91)
- Ability to load datasets in YOLO format using `Dataset.from_yolo`. (https://github.com/roboflow/supervision/pull/86)
- `Detections.merge` to merge multiple `Detections` objects together. (https://github.com/roboflow/supervision/pull/84)

🌱 Changed

- `LineZoneAnnotator.annotate` to allow for the custom text for the in and out tags. (https://github.com/roboflow/supervision/pull/44)

🛠️ Fixed

- `LineZoneAnnotator.annotate` does not return annotated frame. (https://github.com/roboflow/supervision/pull/81)

🏆 Contributors

- SkalskiP
- iPoe
- hardikdava

Page 3 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.