0.18.0
版本发布时间: 2024-01-25 17:46:52
roboflow/supervision最新发布版本:0.24.0(2024-10-05 04:25:47)
🚀 Added
-
sv.PercentageBarAnnotator
allowing to annotate images and videos with percentage values representing confidence or other custom property. (#720)
import supervision as sv
image = ...
detections = sv.Detections(...)
percentage_bar_annotator = sv.PercentageBarAnnotator()
annotated_frame = percentage_bar_annotator.annotate(
scene=image.copy(),
detections=detections
)
-
sv.RoundBoxAnnotator
allowing to annotate images and videos with rounded corners bounding boxes. (#702) -
sv.DetectionsSmoother
allowing for smoothing detections over multiple frames in video tracking. (#696)
https://github.com/roboflow/supervision/assets/26109316/4dd703ad-ffba-492b-97ff-1be84e237e83
-
sv.OrientedBoxAnnotator
allowing to annotate images and videos with OBB (Oriented Bounding Boxes). (#770)
import cv2
import supervision as sv
from ultralytics import YOLO
image = cv2.imread(<SOURCE_IMAGE_PATH>)
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
)
-
sv.ColorPalette.from_matplotlib
allowing users to create asv.ColorPalette
instance from a Matplotlib color palette. (#769)
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
-
sv.Detections.from_ultralytics
adding support for OBB (Oriented Bounding Boxes). (#770) -
sv.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 assv.Position.BOTTOM_CENTER
, or any other combination of anchors defined asList[sv.Position]
. (#735) -
sv.Detections
to support custom payload. (#700) -
sv.Color
's andsv.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
). (#756) (#769)
[!WARNING]
sv.ColorPalette.default()
is deprecated and will be removed insupervision-0.21.0
. Usesv.ColorPalette.DEFAULT
instead.
-
sv.ColorPalette.DEFAULT
value, giving users a more extensive set of annotation colors. (#769)
-
sv.Detections.from_roboflow
tosv.Detections.from_inference
streamlining its functionality to be compatible with both the both inference pip package and the Roboflow hosted API. (#677)
[!WARNING]
Detections.from_roboflow()
is deprecated and will be removed insupervision-0.21.0
. UseDetections.from_inference
instead.
import cv2
import supervision as sv
from inference.models.utils import get_roboflow_model
image = cv2.imread(<SOURCE_IMAGE_PATH>)
model = get_roboflow_model(model_id="yolov8s-640")
result = model.infer(image)[0]
detections = sv.Detections.from_inference(result)
🛠️ Fixed
-
sv.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. (#735)
https://github.com/roboflow/supervision/assets/26109316/412c4d9c-b228-4bcc-a4c7-e6a0c8f2da6e
🏆 Contributors
@onuralpszr (Onuralp SEZER), @HinePo (Rafael Levy), @xaristeidou (Christoforos Aristeidou), @revtheundead (Utku Özbek), @paulguerrie (Paul Guerrie), @yeldarby (Brad Dwyer), @capjamesg (James Gallagher), @SkalskiP (Piotr Skalski)