diff --git a/docs/changelog.md b/docs/changelog.md index c972a2b0..a189ea16 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,75 @@ +### 0.18.0 January 25, 2024 + +- Added [#633](https://github.com/roboflow/supervision/pull/720): [`sv.PercentageBarAnnotator`](https://supervision.roboflow.com/annotators/#percentagebarannotator) allowing to annotate images and videos with percentage values representing confidence or other custom property. + +```python +>>> import supervision as sv + +>>> image = ... +>>> detections = sv.Detections(...) + +>>> percentage_bar_annotator = sv.PercentageBarAnnotator() +>>> annotated_frame = percentage_bar_annotator.annotate( +... scene=image.copy(), +... detections=detections +... ) +``` + +- Added [#702](https://github.com/roboflow/supervision/pull/702): [`sv.RoundBoxAnnotator`](https://supervision.roboflow.com/annotators/#roundboxannotator) allowing to annotate images and videos with rounded corners bounding boxes. + +- Added [#770](https://github.com/roboflow/supervision/pull/770): [`sv.OrientedBoxAnnotator`](https://supervision.roboflow.com/annotators/#orientedboxannotator) allowing to annotate images and videos with OBB (Oriented Bounding Boxes). + +```python +import cv2 +import supervision as sv +from ultralytics import YOLO + +image = cv2.imread() +model = YOLO("yolov8n-obb.pt") + +result = model(image)[0] +detections = sv.Detections.from_ultralytics(result) + +oriented_box_annotator = sv.OrientedBoxAnnotator() +annotated_frame = oriented_box_annotator.annotate( + scene=image.copy(), + detections=detections +) +``` + +- Added [#696](https://github.com/roboflow/supervision/pull/696): [`sv.DetectionsSmoother`](https://supervision.roboflow.com/detection/tools/smoother/#detection-smoother) allowing for smoothing detections over multiple frames in video tracking. + +- Added [#769](https://github.com/roboflow/supervision/pull/769): [`sv.ColorPalette.from_matplotlib`](https://supervision.roboflow.com/draw/color/#supervision.draw.color.ColorPalette.from_matplotlib) allowing users to create a `sv.ColorPalette` instance from a Matplotlib color palette. + +```python +>>> import supervision as sv + +>>> sv.ColorPalette.from_matplotlib('viridis', 5) +ColorPalette(colors=[Color(r=68, g=1, b=84), Color(r=59, g=82, b=139), ...]) +``` + +- Changed [#770](https://github.com/roboflow/supervision/pull/770): [`sv.Detections.from_ultralytics`](https://supervision.roboflow.com/detection/core/#supervision.detection.core.Detections.from_ultralytics) adding support for OBB (Oriented Bounding Boxes). + +- Changed [#735](https://github.com/roboflow/supervision/pull/735): [`sv.LineZone`](https://supervision.roboflow.com/detection/tools/line_zone/#linezone) to now accept a list of specific box anchors that must cross the line for a detection to be counted. This update marks a significant improvement from the previous requirement, where all four box corners were necessary. Users can now specify a single anchor, such as `sv.Position.BOTTOM_CENTER`, or any other combination of anchors defined as `List[sv.Position]`. + +- Changed [#756](https://github.com/roboflow/supervision/pull/756): [`sv.Color`](https://supervision.roboflow.com/draw/color/#color)'s and [`sv.ColorPalette`](https://supervision.roboflow.com/draw/color/#colorpalette)'s method of accessing predefined colors, transitioning from a function-based approach (`sv.Color.red()`) to a more intuitive and conventional property-based method (`sv.Color.RED`). + +!!! warning + + `sv.ColorPalette.default()` is deprecated and will be removed in `supervision-0.21.0`. Use `sv.ColorPalette.DEFAULT` instead. + + +- Changed [#769](https://github.com/roboflow/supervision/pull/769): [`sv.ColorPalette.DEFAULT`](https://supervision.roboflow.com/draw/color/#colorpalette) value, giving users a more extensive set of annotation colors. + +- Changed [#677](https://github.com/roboflow/supervision/pull/677): `sv.Detections.from_roboflow` to [`sv.Detections.from_inference`](https://supervision.roboflow.com/detection/core/#supervision.detection.core.Detections.from_inference) streamlining its functionality to be compatible with both the both [inference](https://github.com/roboflow/inference) pip package and the Robloflow [hosted API](https://docs.roboflow.com/deploy/hosted-api). + +!!! warning + + `Detections.from_roboflow()` is deprecated and will be removed in `supervision-0.21.0`. Use `Detections.from_inference` instead. + + +- Fixed [#735](https://github.com/roboflow/supervision/pull/735): [`sv.LineZone`](https://supervision.roboflow.com/detection/tools/line_zone/#linezone) functionality to accurately update the counter when an object crosses a line from any direction, including from the side. This enhancement enables more precise tracking and analytics, such as calculating individual in/out counts for each lane on the road. + ### 0.17.0 December 06, 2023 - Added [#633](https://github.com/roboflow/supervision/pull/633): [`sv.PixelateAnnotator`](https://supervision.roboflow.com/annotators/#supervision.annotators.core.PixelateAnnotator) allowing to pixelate objects on images and videos. diff --git a/pyproject.toml b/pyproject.toml index ec551816..799d2944 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "supervision" -version = "0.18.0rc4" +version = "0.18.0" description = "A set of easy-to-use utils that will come in handy in any Computer Vision project" authors = ["Piotr Skalski "] maintainers = ["Piotr Skalski "] diff --git a/supervision/annotators/core.py b/supervision/annotators/core.py index e021df53..0ccae515 100644 --- a/supervision/annotators/core.py +++ b/supervision/annotators/core.py @@ -135,11 +135,16 @@ class OrientedBoxAnnotator(BaseAnnotator): Example: ```python + import cv2 import supervision as sv - - image = ... - detections = sv.Detections(...) - + from ultralytics import YOLO + + image = cv2.imread() + model = YOLO("yolov8n-obb.pt") + + result = model(image)[0] + detections = sv.Detections.from_ultralytics(result) + oriented_box_annotator = sv.OrientedBoxAnnotator() annotated_frame = oriented_box_annotator.annotate( scene=image.copy(),