Skip to content

Releases: roboflow/supervision

supervision-0.9.0

07 Jun 11:17
Compare
Choose a tag to compare

πŸš€ Added

  • Ability to select sv.Detections by index, list of indexes or slice. Here is an example illustrating the new selection methods. (#118)
>>> 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)

  • Ability to extract masks from YOLOv8 results using sv.Detections.from_yolov8. Here is an example illustrating how to extract boolean masks from the result of the YOLOv8 model inference. (#101)
>>> 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. Here is an example showing how to get a separate crop for each detection in sv.Detections. (#122)
>>> 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. An example shows how to save every tenth video frame as a separate image. (#120)
>>> 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 coordinates. Now sv.PolygonZone accepts coordinates in the form of [[x1, y1], [x2, y2], ...] that can be both integers and floats. (#106)

πŸ† Contributors

@SkalskiP @lomnes-atlast-food @hardikdava

supervision-0.8.0

17 May 19:28
Compare
Choose a tag to compare

πŸš€ Added

  • Support for dataset inheritance. The current Dataset got renamed to DetectionDataset. Now DetectionDataset inherits from BaseDataset. This change was made to enforce the future consistency of APIs of different types of computer vision datasets. (#100)
  • Ability to save datasets in YOLO format using DetectionDataset.as_yolo. (#100)
>>> import supervision as sv

>>> ds = sv.DetectionDataset(...)
>>> ds.as_yolo(
...     images_directory_path='...',
...     annotations_directory_path='...',
...     data_yaml_path='...'
... )
>>> 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. (#100)

1

πŸ† Contributors

supervision-0.7.0

10 May 22:43
Compare
Choose a tag to compare

πŸš€ Added

  • Detections.from_yolo_nas to enable seamless integration with YOLO-NAS model. (#91)
  • Ability to load datasets in YOLO format using Dataset.from_yolo. (#86)
  • Detections.merge to merge multiple Detections objects together. (#84)

🌱 Changed

  • LineZoneAnnotator.annotate to allow for the custom text for the in and out tags. (#44)

πŸ› οΈ Fixed

  • LineZoneAnnotator.annotate does not return annotated frame. (#81)

πŸ† Contributors

supervision-0.6.0

19 Apr 21:08
2945013
Compare
Choose a tag to compare

πŸš€ Added

  • Initial Dataset support and ability to save Detections in Pascal VOC XML format. (#71)
  • New mask_to_polygons, filter_polygons_by_area, polygon_to_xyxy and approximate_polygon utilities. (#71)
  • Ability to load Pascal VOC XML object detections dataset as Dataset. (#72)

🌱 Changed

  • order of Detections attributes to make it consistent with order of objects in __iter__ tuple. (#70)
  • generate_2d_mask to polygon_to_mask. (#71)

πŸ† Contributors

supervision-0.5.2

13 Apr 09:10
7497f8d
Compare
Choose a tag to compare

πŸ› οΈ Fixed

  • Fixed LineZone.trigger function expects 4 values instead of 5 (#63)

πŸ† Contributors

supervision-0.5.1

12 Apr 16:00
Compare
Choose a tag to compare

πŸ› οΈ Fixed

  • Fixed Detections.__getitem__ method did not return mask for selected item.
  • Fixed Detections.area crashed for mask detections.

πŸ† Contributors

supervision-0.5.0

10 Apr 22:07
dba4d9f
Compare
Choose a tag to compare

πŸš€ Added

  • Detections.mask to enable segmentation support. (#58)
  • MaskAnnotator to allow easy Detections.mask annotation. (#58)
  • Detections.from_sam to enable native Segment Anything Model (SAM) support. (#58)

🌱 Changed

  • Detections.area behaviour to work not only with boxes but also with masks. (#58)

πŸ† Contributors

supervision-0.4.0

05 Apr 15:33
bc12a8e
Compare
Choose a tag to compare

πŸš€ Added

  • Detections.empty to allow easy creation of empty Detections objects. (#48)
  • Detections.from_roboflow to allow easy creation of Detections objects from Roboflow API inference results. (#56)
  • plot_images_grid to allow easy plotting of multiple images on single plot. (#56)
  • Initial support for Pascal VOC XML format with detections_to_voc_xml method. (#56)

🌱 Changed

  • show_frame_in_notebook refactored and renamed to plot_image. (#56)

πŸ† Contributors

supervision-0.3.2

24 Mar 16:49
2df4261
Compare
Choose a tag to compare

🌱 Changed

  • Drop requirement for class_id in sv.Detections (#50) to make it more flexible

πŸ† Contributors

supervision-0.3.1

14 Mar 13:46
Compare
Choose a tag to compare

🌱 Changed

  • Detections.wth_nms support class agnostic and non-class agnostic case (#36)

πŸ› οΈ Fixed

  • PolygonZone throws an exception when the object touches the bottom edge of the image (#41)
  • Detections.wth_nms method throws an exception when Detections is empty (#42)

πŸ† Contributors