0.22.0
版本发布时间: 2024-07-13 01:14:38
roboflow/supervision最新发布版本:0.24.0(2024-10-05 04:25:47)
🚀 Added
-
sv.KeyPoints.from_mediapipe
adding support for Mediapipe keypoint models (both legacy and modern), along with default visualizers for face and body pose keypoints. (#1232, #1316)
import numpy as np
import mediapipe as mp
import supervision as sv
from PIL import Image
model = mp.solutions.face_mesh.FaceMesh()
edge_annotator = sv.EdgeAnnotator(color=sv.Color.BLACK, thickness=2)
image = Image.open(<PATH_TO_IMAGE>).convert('RGB')
results = model.process(np.array(image))
key_points = sv.KeyPoints.from_mediapipe(results, resolution_wh=image.size)
annotated_image = edge_annotator.annotate(scene=image, key_points=key_points)
https://github.com/user-attachments/assets/883a6bcc-5e39-41b0-9b6d-0348b5b2fe0e
-
sv.KeyPoints.from_detectron2
andsv.Detections.from_detectron2
extending support for Detectron2 models. (#1310, #1300) -
sv.RichLabelAnnotator
allowing to draw unicode characters (e.g. from non-latin languages), as long as you provide a compatible font. (#1277)
https://github.com/user-attachments/assets/cc728fbc-9dec-478d-b0da-5705107eccbc
🌱 Changed
-
sv.DetectionsDataset
andsv.ClassificationDataset
allowing to load the images into memory only when necessary (lazy loading). (#1326)
import roboflow
from roboflow import Roboflow
import supervision as sv
roboflow.login()
rf = Roboflow()
project = rf.workspace(<WORKSPACE_ID>).project(<PROJECT_ID>)
dataset = project.version(<PROJECT_VERSION>).download("coco")
ds_train = sv.DetectionDataset.from_coco(
images_directory_path=f"{dataset.location}/train",
annotations_path=f"{dataset.location}/train/_annotations.coco.json",
)
path, image, annotation = ds_train[0]
# loads image on demand
for path, image, annotation in ds_train:
# loads image on demand
-
sv.Detections.from_lmm
allowing to parse Florence-2 text result intosv.Detections
object. (#1296)
-
sv.DotAnnotator
andsv.TriangleAnnotator
allowing to add marker outlines. (#1294)
🛠️ Fixed
-
sv.ColorAnnotator
andsv.CropAnnotator
buggy behaviours. (#1277, #1312)
🧑🍳 Cookbooks
This release, @onuralpszr added two new Cookbooks to our collection. Check them out to learn how to save Detections
to a file and convert it back to Detections
!
🏆 Contributors
@onuralpszr (Onuralp SEZER), @David-rn (David Redó), @jeslinpjames (Jeslin P James), @Bhavay-2001 (Bhavay Malhotra), @hardikdava (Hardik Dava), @kirilman, @dsaha21 (Dripto Saha), @cdragos (Dragos Catarahia), @mqasim41 (Muhammad Qasim), @SkalskiP (Piotr Skalski), @LinasKo (Linas Kondrackis)
Special thanks to @rolson24 (Raif Olson) for helping the community with ByteTrack
!