Supervision

Latest version: v0.21.0

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

Scan your dependencies

Page 2 of 5

0.17.0

🚀 Added

- [`sv.PixelateAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.PixelateAnnotator) allowing to pixelate objects on images and videos. ([633](https://github.com/roboflow/supervision/pull/633))

https://github.com/roboflow/supervision/assets/26109316/c2d4b3b1-fd19-44bb-94ec-f21b28dfd05f

- [`sv.TriangleAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.TriangleAnnotator) allowing to annotate images and videos with triangle markers. ([652](https://github.com/roboflow/supervision/pull/652))

- [`sv.PolygonAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.PolygonAnnotator) allowing to annotate images and videos with segmentation mask outline. ([602](https://github.com/roboflow/supervision/pull/602))

python
>>> import supervision as sv

>>> image = ...
>>> detections = sv.Detections(...)

>>> polygon_annotator = sv.PolygonAnnotator()
>>> annotated_frame = polygon_annotator.annotate(
... scene=image.copy(),
... detections=detections
... )


https://github.com/roboflow/supervision/assets/26109316/c9236bf7-6ba4-4799-bf2a-b5532ad3591b

- [`sv.assets`](https://supervision.roboflow.com/assets/) allowing download of video files that you can use in your demos. ([#476](https://github.com/roboflow/supervision/pull/476))

python
>>> from supervision.assets import download_assets, VideoAssets
>>> download_assets(VideoAssets.VEHICLES)
"vehicles.mp4"


- [`Position.CENTER_OF_MASS`](https://supervision.roboflow.com/geometry/core/#position) allowing to place labels in center of mass of segmentation masks. ([605](https://github.com/roboflow/supervision/pull/605))

- [`sv.scale_boxes`](https://supervision.roboflow.com/detection/utils/#supervision.detection.utils.scale_boxes) allowing to scale [`sv.Detections.xyxy`](http://127.0.0.1:8000/detection/core/#supervision.detection.core.Detections) values. ([651](https://github.com/roboflow/supervision/pull/651))

- [`sv.calculate_dynamic_text_scale`](https://supervision.roboflow.com/draw/utils/#supervision.draw.utils.calculate_dynamic_text_scale) and [`sv.calculate_dynamic_line_thickness`](https://supervision.roboflow.com/draw/utils/#supervision.draw.utils.calculate_dynamic_line_thickness) allowing text scale and line thickness to match image resolution. ([637](https://github.com/roboflow/supervision/pull/637))

- [`sv.Color.as_hex`](https://supervision.roboflow.com/draw/color/#supervision.draw.color.Color.as_hex) allowing to extract color value in HEX format. ([620](https://github.com/roboflow/supervision/pull/620))

- [`sv.Classifications.from_timm`](https://supervision.roboflow.com/classification/core/#supervision.classification.core.Classifications.from_timm) allowing to load classification result from [timm](https://huggingface.co/docs/hub/timm) models. ([#572](https://github.com/roboflow/supervision/pull/572))

- [`sv.Classifications.from_clip`](https://supervision.roboflow.com/classification/core/#supervision.classification.core.Classifications.from_clip) allowing to load classification result from [clip](https://github.com/openai/clip) model. ([#478](https://github.com/roboflow/supervision/pull/478))

- [`sv.Detections.from_azure_analyze_image`](https://supervision.roboflow.com/detection/core/#supervision.detection.core.Detections.from_azure_analyze_image) allowing to load detection results from [Azure Image Analysis](https://learn.microsoft.com/en-us/azure/ai-services/computer-vision/concept-object-detection-40). ([#571](https://github.com/roboflow/supervision/pull/571))

🌱 Changed

- `sv.BoxMaskAnnotator` renaming it to [`sv.ColorAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.ColorAnnotator). ([646](https://github.com/roboflow/supervision/pull/646))

- [`sv.MaskAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.MaskAnnotator) to make it **5x faster**. ([606](https://github.com/roboflow/supervision/pull/606))

![mask_annotator_speed](https://github.com/roboflow/supervision/assets/26109316/8c4b87d1-f257-489e-9e0e-2ffe9ccbc367)

🛠️ Fixed

- [`sv.DetectionDataset.from_yolo`](https://supervision.roboflow.com/datasets/#supervision.dataset.core.DetectionDataset.from_yolo) to ignore empty lines in annotation files. ([584](https://github.com/roboflow/supervision/pull/584))

- [`sv.BlurAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.BlurAnnotator) to trim negative coordinates before bluring detections. ([555](https://github.com/roboflow/supervision/pull/555))

- [`sv.TraceAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.TraceAnnotator) to respect trace position. ([511](https://github.com/roboflow/supervision/pull/511))

🏆 Contributors

onuralpszr (Onuralp SEZER), hugoles (Hugo Dutra), karanjakhar (Karan Jakhar), kim-jeonghyun (Jeonghyun Kim), fdloopes (
Felipe Lopes), abhishek7kalra (Abhishek Kalra), SummitStudiosDev, xenteros capjamesg (James Gallagher), SkalskiP (Piotr Skalski)

0.16.0

🚀 Added

https://github.com/roboflow/supervision/assets/26109316/691e219c-0565-4403-9218-ab5644f39bce

- [`sv.BoxMaskAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.BoxMaskAnnotator) allowing to annotate images and videos with mox masks. ([422](https://github.com/roboflow/supervision/pull/422))
- [`sv.HaloAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.HaloAnnotator) allowing to annotate images and videos with halo effect. ([433](https://github.com/roboflow/supervision/pull/433))

python
>>> import supervision as sv

>>> image = ...
>>> detections = sv.Detections(...)

>>> halo_annotator = sv.HaloAnnotator()
>>> annotated_frame = halo_annotator.annotate(
... scene=image.copy(),
... detections=detections
... )


- [`sv.HeatMapAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.HeatMapAnnotator) allowing to annotate videos with heat maps. ([466](https://github.com/roboflow/supervision/pull/466))
- [`sv.DotAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.DotAnnotator) allowing to annotate images and videos with dots. ([492](https://github.com/roboflow/supervision/pull/492))
- [`sv.draw_image`](https://supervision.roboflow.com/draw/utils/#supervision.draw.utils.draw_image) allowing to draw an image onto a given scene with specified opacity and dimensions. ([449](https://github.com/roboflow/supervision/pull/449))
- [`sv.FPSMonitor`](https://supervision.roboflow.com/utils/video/#supervision.utils.video.FPSMonitor) for monitoring frames per second (FPS) to benchmark latency. ([280](https://github.com/roboflow/supervision/pull/280))
- 🤗 Hugging Face Annotators [space](https://huggingface.co/spaces/Roboflow/Annotators). ([#454](https://github.com/roboflow/supervision/pull/454))

🌱 Changed

- [`sv.LineZone.trigger `](https://supervision.roboflow.com/detection/tools/line_zone/#supervision.detection.line_counter.LineZone.trigger) now return `Tuple[np.ndarray, np.ndarray]`. The first array indicates which detections have crossed the line from outside to inside. The second array indicates which detections have crossed the line from inside to outside. ([482](https://github.com/roboflow/supervision/pull/482))
- Annotator argument name from `color_map: str` to `color_lookup: ColorLookup` enum to increase type safety. ([465](https://github.com/roboflow/supervision/pull/465))
- [`sv.MaskAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.MaskAnnotator) allowing 2x faster annotation. ([426](https://github.com/roboflow/supervision/pull/426))

🛠️ Fixed

- Poetry env definition allowing proper local installation. ([477](https://github.com/roboflow/supervision/pull/477))
- [`sv.ByteTrack`](https://supervision.roboflow.com/trackers/#supervision.tracker.byte_tracker.core.ByteTrack) to return `np.array([], dtype=int)` when `svDetections` is empty. ([430](https://github.com/roboflow/supervision/pull/430))
- YOLONAS detection missing predication part added & fixed (416)
- SAM detection at Demo Notebook `MaskAnnotator(color_map="index")` `color_map` set to `index` (416)

🗑️ Deleted

> **Warning**
> Deleted `sv.Detections.from_yolov8` and `sv.Classifications.from_yolov8` as those are now replaced by [`sv.Detections.from_ultralytics`](https://supervision.roboflow.com/detection/core/#supervision.detection.core.Detections.from_ultralytics) and [`sv.Classifications.from_ultralytics`](https://supervision.roboflow.com/classification/core/#supervision.classification.core.Classifications.from_ultralytics). ([438](https://github.com/roboflow/supervision/pull/438))

🏆 Contributors

hardikdava (Hardik Dava), onuralpszr (Onuralp SEZER), kapter, keshav278 (Keshav Subramanian), akashpambhar (Akash Pambhar), AntonioConsiglio (Antonio Consiglio), ashishdatta, mario-dg (Mario da Graca), jayaBalaR (JAYABALAMBIKA.R), abhishek7kalra (Abhishek Kalra), PankajKrana (Pankaj Kumar Rana), capjamesg (James Gallagher), SkalskiP (Piotr Skalski)

0.15.0

🚀 Added

https://github.com/roboflow/supervision/assets/26109316/4d6c4a70-b40e-48fc-9e58-23b7e67bf94a

- [`sv.LabelAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.LabelAnnotator) allowing to annotate images and videos with text. ([170](https://github.com/roboflow/supervision/pull/170))

- [`sv.BoundingBoxAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.BoundingBoxAnnotator) allowing to annotate images and videos with bounding boxes. ([170](https://github.com/roboflow/supervision/pull/170))

- [`sv.BoxCornerAnnotator `](https://supervision.roboflow.com/annotators/#supervision.annotators.core.BoxCornerAnnotator) allowing to annotate images and videos with just bounding box corners. ([170](https://github.com/roboflow/supervision/pull/170))

- [`sv.MaskAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.MaskAnnotator) allowing to annotate images and videos with segmentation masks. ([170](https://github.com/roboflow/supervision/pull/170))

- [`sv.EllipseAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.EllipseAnnotator) allowing to annotate images and videos with ellipses (sports game style). ([170](https://github.com/roboflow/supervision/pull/170))

- [`sv.CircleAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.CircleAnnotator) allowing to annotate images and videos with circles. ([386](https://github.com/roboflow/supervision/pull/386))

- [`sv.TraceAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.TraceAnnotator) allowing to draw path of moving objects on videos. ([354](https://github.com/roboflow/supervision/pull/354))

- [`sv.BlurAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.BlurAnnotator) allowing to blur objects on images and videos. ([405](https://github.com/roboflow/supervision/pull/405))

python
>>> import supervision as sv

>>> image = ...
>>> detections = sv.Detections(...)

>>> bounding_box_annotator = sv.BoundingBoxAnnotator()
>>> annotated_frame = bounding_box_annotator.annotate(
... scene=image.copy(),
... detections=detections
... )


- Supervision usage [example](https://github.com/roboflow/supervision/tree/develop/examples/traffic_analysis). You can now learn how to perform traffic flow analysis with Supervision. ([#354](https://github.com/roboflow/supervision/pull/354))

https://github.com/roboflow/supervision/assets/26109316/c9436828-9fbf-4c25-ae8c-60e9c81b3900

🌱 Changed

- [`sv.Detections.from_roboflow`](https://supervision.roboflow.com/detection/core/#supervision.detection.core.Detections.from_roboflow) now does not require `class_list` to be specified. The `class_id` value can be extracted directly from the [inference](https://github.com/roboflow/inference) response. ([#399](https://github.com/roboflow/supervision/pull/399))

- [`sv.VideoSink`](https://supervision.roboflow.com/utils/video/#videosink) now allows to customize the output codec. ([381](https://github.com/roboflow/supervision/pull/381))

- [`sv.InferenceSlicer`](https://supervision.roboflow.com/detection/tools/inference_slicer/#supervision.detection.tools.inference_slicer.InferenceSlicer) can now operate in multithreading mode. ([361](https://github.com/roboflow/supervision/pull/361))

🛠️ Fixed

- [`sv.Detections.from_deepsparse`](https://supervision.roboflow.com/detection/core/#supervision.detection.core.Detections.from_deepsparse) to allow processing empty [deepsparse](https://github.com/neuralmagic/deepsparse) result object. ([#348](https://github.com/roboflow/supervision/pull/348))

🏆 Contributors

hardikdava (Hardik Dava), onuralpszr (Onuralp SEZER), Killua7362 (Akshay Bhat), fcakyon (Fatih C. Akyon), akashAD98 (Akash A Desai), Rajarshi-Misra (Rajarshi Misra), capjamesg (James Gallagher), SkalskiP (Piotr Skalski)

0.14.0

🚀 Added

- Support for SAHI inference technique with [`sv.InferenceSlicer`](https://supervision.roboflow.com/detection/tools/inference_slicer). ([#282](https://github.com/roboflow/supervision/pull/282))

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

>>> image = cv2.imread(SOURCE_IMAGE_PATH)
>>> model = YOLO(...)

>>> def callback(image_slice: np.ndarray) -> sv.Detections:
... result = model(image_slice)[0]
... return sv.Detections.from_ultralytics(result)

>>> slicer = sv.InferenceSlicer(callback = callback)

>>> detections = slicer(image)


https://github.com/roboflow/supervision/assets/26109316/da665575-4d74-469c-a1f7-a43b7ee7e214

- [`Detections.from_deepsparse`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.from_deepsparse) to enable seamless integration with [DeepSparse](https://github.com/neuralmagic/deepsparse) framework. ([#297](https://github.com/roboflow/supervision/pull/297))

- [`sv.Classifications.from_ultralytics`](https://supervision.roboflow.com/classification/core/#supervision.classification.core.Classifications.from_ultralytics) to enable seamless integration with [Ultralytics](https://github.com/ultralytics/ultralytics) framework. This will enable you to use supervision with all [models](https://docs.ultralytics.com/models/) that Ultralytics supports. ([#281](https://github.com/roboflow/supervision/pull/281))

> **Warning**
> [`sv.Detections.from_yolov8`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.from_yolov8) and [`sv.Classifications.from_yolov8`](https://supervision.roboflow.com/classification/core/#supervision.classification.core.Classifications.from_yolov8) are now deprecated and will be removed with `supervision-0.16.0` release.

- First supervision usage example script showing how to detect and track objects on video using YOLOv8 + Supervision. ([341](https://github.com/roboflow/supervision/pull/341))

https://github.com/roboflow/supervision/assets/26109316/d8128440-6bd7-491a-8c7d-519254b76ec5

🌱 Changed

- [`sv.ClassificationDataset`](https://supervision.roboflow.com/dataset/core/#supervision.dataset.core.ClassificationDataset) and [`sv.DetectionDataset`](https://supervision.roboflow.com/dataset/core/#supervision.dataset.core.DetectionDataset) now use image path (not image name) as dataset keys. ([296](https://github.com/roboflow/supervision/pull/296))

🛠️ Fixed

- [`Detections.from_roboflow`](https://supervision.roboflow.com/detection/core/#supervision.detection.core.Detections.from_roboflow) to filter out polygons with less than 3 points. ([300](https://github.com/roboflow/supervision/pull/300))

🏆 Contributors

hardikdava (Hardik Dava), onuralpszr (Onuralp SEZER), mayankagarwals (Mayank Agarwal), rizavelioglu (Riza Velioglu), arjun-234 (Arjun D.), mwitiderrick (Derrick Mwiti), ShubhamKanitkar32, gasparitiago (Tiago De Gaspari), capjamesg (James Gallagher), SkalskiP (Piotr Skalski)

0.13.0

🚀 Added

- Support for mean average precision (mAP) for object detection models with [`sv.MeanAveragePrecision`](https://roboflow.github.io/supervision/metrics/detection/#meanaverageprecision). ([236](https://github.com/roboflow/supervision/pull/236))

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

>>> dataset = sv.DetectionDataset.from_yolo(...)

>>> model = YOLO(...)
>>> def callback(image: np.ndarray) -> sv.Detections:
... result = model(image)[0]
... return sv.Detections.from_yolov8(result)

>>> mean_average_precision = sv.MeanAveragePrecision.benchmark(
... dataset = dataset,
... callback = callback
... )

>>> mean_average_precision.map50_95

0.12.0

> **Warning**
> With the `supervision-0.12.0` release, we are terminating official support for Python 3.7. ([179](https://github.com/roboflow/supervision/issues/179))

🚀 Added

- Initial support for object detection model benchmarking with [`sv.ConfusionMatrix`](https://roboflow.github.io/supervision/metrics/detection/#confusionmatrix). ([177](https://github.com/roboflow/supervision/pull/177))

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

>>> dataset = sv.DetectionDataset.from_yolo(...)

>>> model = YOLO(...)
>>> def callback(image: np.ndarray) -> sv.Detections:
... result = model(image)[0]
... return sv.Detections.from_yolov8(result)

>>> confusion_matrix = sv.ConfusionMatrix.benchmark(
... dataset = dataset,
... callback = callback
... )

>>> confusion_matrix.matrix
array([
[0., 0., 0., 0.],
[0., 1., 0., 1.],
[0., 1., 1., 0.],
[1., 1., 0., 0.]
])


- [`Detections.from_mmdetection`](https://roboflow.github.io/supervision/detection/core/#supervision.detection.core.Detections.from_mmdetection) to enable seamless integration with [MMDetection](https://github.com/open-mmlab/mmdetection) framework. ([#173](https://github.com/roboflow/supervision/pull/173))

- Ability to [install](https://roboflow.github.io/supervision/) package in `headless` or `desktop` mode. ([#130](https://github.com/roboflow/supervision/issues/130))

![Snap (51)](https://github.com/roboflow/supervision/assets/26109316/f2a3fdcd-a67b-4386-80e9-7ef6419cac59)

🌱 Changed

- Packing method from `setup.py` to `pyproject.toml`. ([180](https://github.com/roboflow/supervision/pull/180))

🛠️ Fixed

- [`sv.DetectionDataset.from_cooc`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.from_coco) can't be loaded when there are images without annotations. ([188](https://github.com/roboflow/supervision/issues/188))
- [`sv.DetectionDataset.from_yolo`](https://roboflow.github.io/supervision/dataset/core/#supervision.dataset.core.DetectionDataset.from_yolo) can't load background instances. ([226](https://github.com/roboflow/supervision/issues/226))

🏆 Contributors

kirilllzaitsev hardikdava onuralpszr Ucag SkalskiP capjamesg

Page 2 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.