|
| 1 | +### 0.21.0 <small>Jun 5, 2024</small> |
| 2 | + |
| 3 | +- Added [#500](https://github.com/roboflow/supervision/pull/500): [`sv.Detections.with_nmm`](https://supervision.roboflow.com/develop/detection/core/#supervision.detection.core.Detections.with_nmm) to perform non-maximum merging on the current set of object detections. |
| 4 | + |
| 5 | +- Added [#1221](https://github.com/roboflow/supervision/pull/1221): [`sv.Detections.from_lmm`](https://supervision.roboflow.com/develop/detection/core/#supervision.detection.core.Detections.from_lmm) allowing to parse Large Multimodal Model (LMM) text result into [`sv.Detections`](https://supervision.roboflow.com/develop/detection/core/) object. For now `from_lmm` supports only [PaliGemma](https://colab.research.google.com/github/roboflow-ai/notebooks/blob/main/notebooks/how-to-finetune-paligemma-on-detection-dataset.ipynb) result parsing. |
| 6 | + |
| 7 | +```python |
| 8 | +import supervision as sv |
| 9 | + |
| 10 | +paligemma_result = "<loc0256><loc0256><loc0768><loc0768> cat" |
| 11 | +detections = sv.Detections.from_lmm( |
| 12 | + sv.LMM.PALIGEMMA, |
| 13 | + paligemma_result, |
| 14 | + resolution_wh=(1000, 1000), |
| 15 | + classes=['cat', 'dog'] |
| 16 | +) |
| 17 | +detections.xyxy |
| 18 | +# array([[250., 250., 750., 750.]]) |
| 19 | + |
| 20 | +detections.class_id |
| 21 | +# array([0]) |
| 22 | +``` |
| 23 | + |
| 24 | +- Added [#1236](https://github.com/roboflow/supervision/pull/1236): [`sv.VertexLabelAnnotator`](https://supervision.roboflow.com/develop/keypoint/annotators/#supervision.keypoint.annotators.EdgeAnnotator.annotate) allowing to annotate every vertex of a keypoint skeleton with custom text and color. |
| 25 | + |
| 26 | +```python |
| 27 | +import supervision as sv |
| 28 | + |
| 29 | +image = ... |
| 30 | +key_points = sv.KeyPoints(...) |
| 31 | + |
| 32 | +edge_annotator = sv.EdgeAnnotator( |
| 33 | + color=sv.Color.GREEN, |
| 34 | + thickness=5 |
| 35 | +) |
| 36 | +annotated_frame = edge_annotator.annotate( |
| 37 | + scene=image.copy(), |
| 38 | + key_points=key_points |
| 39 | +) |
| 40 | +``` |
| 41 | + |
| 42 | +- Added [#1147](https://github.com/roboflow/supervision/pull/1147): [`sv.KeyPoints.from_inference`](https://supervision.roboflow.com/develop/keypoint/core/#supervision.keypoint.core.KeyPoints.from_inference) allowing to create [`sv.KeyPoints`](https://supervision.roboflow.com/develop/keypoint/core/#supervision.keypoint.core.KeyPoints) from [Inference](https://github.com/roboflow/inference) result. |
| 43 | + |
| 44 | +- Added [#1138](https://github.com/roboflow/supervision/pull/1138): [`sv.KeyPoints.from_yolo_nas`](https://supervision.roboflow.com/develop/keypoint/core/#supervision.keypoint.core.KeyPoints.from_yolo_nas) allowing to create [`sv.KeyPoints`](https://supervision.roboflow.com/develop/keypoint/core/#supervision.keypoint.core.KeyPoints) from [YOLO-NAS](https://github.com/Deci-AI/super-gradients/blob/master/YOLONAS.md) result. |
| 45 | + |
| 46 | +- Added [#1163](https://github.com/roboflow/supervision/pull/1163): [`sv.mask_to_rle`](https://supervision.roboflow.com/develop/datasets/utils/#supervision.dataset.utils.rle_to_mask) and [`sv.rle_to_mask`](https://supervision.roboflow.com/develop/datasets/utils/#supervision.dataset.utils.rle_to_mask) allowing for easy conversion between mask and rle formats. |
| 47 | + |
| 48 | +- Changed [#1236](https://github.com/roboflow/supervision/pull/1236): [`sv.InferenceSlicer`](https://supervision.roboflow.com/develop/detection/tools/inference_slicer/) allowing to select overlap filtering strategy (`NONE`, `NON_MAX_SUPPRESSION` and `NON_MAX_MERGE`). |
| 49 | + |
| 50 | +- Changed [#1178](https://github.com/roboflow/supervision/pull/1178): [`sv.InferenceSlicer`](https://supervision.roboflow.com/develop/detection/tools/inference_slicer/) adding instance segmentation model support. |
| 51 | + |
| 52 | +```python |
| 53 | +import cv2 |
| 54 | +import numpy as np |
| 55 | +import supervision as sv |
| 56 | +from inference import get_model |
| 57 | + |
| 58 | +model = get_model(model_id="yolov8x-seg-640") |
| 59 | +image = cv2.imread(<SOURCE_IMAGE_PATH>) |
| 60 | + |
| 61 | +def callback(image_slice: np.ndarray) -> sv.Detections: |
| 62 | + results = model.infer(image_slice)[0] |
| 63 | + return sv.Detections.from_inference(results) |
| 64 | + |
| 65 | +slicer = sv.InferenceSlicer(callback = callback) |
| 66 | +detections = slicer(image) |
| 67 | + |
| 68 | +mask_annotator = sv.MaskAnnotator() |
| 69 | +label_annotator = sv.LabelAnnotator() |
| 70 | + |
| 71 | +annotated_image = mask_annotator.annotate( |
| 72 | + scene=image, detections=detections) |
| 73 | +annotated_image = label_annotator.annotate( |
| 74 | + scene=annotated_image, detections=detections) |
| 75 | +``` |
| 76 | + |
| 77 | +- Changed [#1228](https://github.com/roboflow/supervision/pull/1228): [`sv.LineZone`](https://supervision.roboflow.com/develop/detection/tools/line_zone/) making it 10-20 times faster, depending on the use case. |
| 78 | + |
| 79 | +- Changed [#1163](https://github.com/roboflow/supervision/pull/1163): [`sv.DetectionDataset.from_coco`](https://supervision.roboflow.com/develop/datasets/core/#supervision.dataset.core.DetectionDataset.from_coco) and [`sv.DetectionDataset.as_coco`](https://supervision.roboflow.com/develop/datasets/core/#supervision.dataset.core.DetectionDataset.as_coco) adding support for run-length encoding (RLE) mask format. |
| 80 | + |
1 | 81 | ### 0.20.0 <small>April 24, 2024</small> |
2 | 82 |
|
3 | 83 | - Added [#1128](https://github.com/roboflow/supervision/pull/1128): [`sv.KeyPoints`](/0.20.0/keypoint/core/#supervision.keypoint.core.KeyPoints) to provide initial support for pose estimation and broader keypoint detection models. |
|
0 commit comments