|
| 1 | +### 0.20.0 <small>April 24, 2024</small> |
| 2 | + |
| 3 | +- 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. |
| 4 | + |
| 5 | +- Added [#1128](https://github.com/roboflow/supervision/pull/1128): [`sv.EdgeAnnotator`](/0.20.0/keypoint/annotators/#supervision.keypoint.annotators.EdgeAnnotator) and [`sv.VertexAnnotator`](/0.20.0/keypoint/annotators/#supervision.keypoint.annotators.VertexAnnotator) to enable rendering of results from keypoint detection models. |
| 6 | + |
| 7 | +```python |
| 8 | +import cv2 |
| 9 | +import supervision as sv |
| 10 | +from ultralytics import YOLO |
| 11 | + |
| 12 | +image = cv2.imread(<SOURCE_IMAGE_PATH>) |
| 13 | +model = YOLO('yolov8l-pose') |
| 14 | + |
| 15 | +result = model(image, verbose=False)[0] |
| 16 | +keypoints = sv.KeyPoints.from_ultralytics(result) |
| 17 | + |
| 18 | +edge_annotators = sv.EdgeAnnotator(color=sv.Color.GREEN, thickness=5) |
| 19 | +annotated_image = edge_annotators.annotate(image.copy(), keypoints) |
| 20 | +``` |
| 21 | + |
| 22 | +- Changed [#1037](https://github.com/roboflow/supervision/pull/1037): [`sv.LabelAnnotator`](/0.20.0/annotators/#supervision.annotators.core.LabelAnnotator) by adding an additional `corner_radius` argument that allows for rounding the corners of the bounding box. |
| 23 | + |
| 24 | +- Changed [#1109](https://github.com/roboflow/supervision/pull/1109): [`sv.PolygonZone`](/0.20.0/detection/tools/polygon_zone/#supervision.detection.tools.polygon_zone.PolygonZone) such that the `frame_resolution_wh` argument is no longer required to initialize `sv.PolygonZone`. |
| 25 | + |
| 26 | +!!! failure "Deprecated" |
| 27 | + |
| 28 | + The `frame_resolution_wh` parameter in `sv.PolygonZone` is deprecated and will be removed in `supervision-0.24.0`. |
| 29 | + |
| 30 | +- Changed [#1084](https://github.com/roboflow/supervision/pull/1084): [`sv.get_polygon_center`](/0.20.0/utils/geometry/#supervision.geometry.core.utils.get_polygon_center) to calculate a more accurate polygon centroid. |
| 31 | + |
| 32 | +- Changed [#1069](https://github.com/roboflow/supervision/pull/1069): [`sv.Detections.from_transformers`](/0.20.0/detection/core/#supervision.detection.core.Detections.from_transformers) by adding support for Transformers segmentation models and extract class names values. |
| 33 | + |
| 34 | +```python |
| 35 | +import torch |
| 36 | +import supervision as sv |
| 37 | +from PIL import Image |
| 38 | +from transformers import DetrImageProcessor, DetrForSegmentation |
| 39 | + |
| 40 | +processor = DetrImageProcessor.from_pretrained("facebook/detr-resnet-50-panoptic") |
| 41 | +model = DetrForSegmentation.from_pretrained("facebook/detr-resnet-50-panoptic") |
| 42 | + |
| 43 | +image = Image.open(<SOURCE_IMAGE_PATH>) |
| 44 | +inputs = processor(images=image, return_tensors="pt") |
| 45 | + |
| 46 | +with torch.no_grad(): |
| 47 | + outputs = model(**inputs) |
| 48 | + |
| 49 | +width, height = image.size |
| 50 | +target_size = torch.tensor([[height, width]]) |
| 51 | +results = processor.post_process_segmentation( |
| 52 | + outputs=outputs, target_sizes=target_size)[0] |
| 53 | +detections = sv.Detections.from_transformers(results, id2label=model.config.id2label) |
| 54 | + |
| 55 | +mask_annotator = sv.MaskAnnotator() |
| 56 | +label_annotator = sv.LabelAnnotator(text_position=sv.Position.CENTER) |
| 57 | + |
| 58 | +annotated_image = mask_annotator.annotate( |
| 59 | + scene=image, detections=detections) |
| 60 | +annotated_image = label_annotator.annotate( |
| 61 | + scene=annotated_image, detections=detections) |
| 62 | +``` |
| 63 | + |
| 64 | +- Fixed [#787](https://github.com/roboflow/supervision/pull/787): [`sv.ByteTrack.update_with_detections`](/0.20.0/trackers/#supervision.tracker.byte_tracker.core.ByteTrack.update_with_detections) which was removing segmentation masks while tracking. Now, `ByteTrack` can be used alongside segmentation models. |
| 65 | + |
1 | 66 | ### 0.19.0 <small>March 15, 2024</small>
|
2 | 67 |
|
3 | 68 | - 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.
|
|
0 commit comments