-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sv.RoundBoxAnnotator
which annotates bounding box with round edges
#702
Conversation
sv.RoundBoundingBoxAnnotator
which annotates bounding box with round edges
@xaristeidou hello, first of it looks amazing. 🚀 I am taking the review. |
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
Simple Test Collab Link and python code Google Collab link here #!pip install git+https://github.com/xaristeidou/supervision.git@develop
#!pip install requests tqdm ultralytics
import supervision as sv
from supervision.assets import download_assets, VideoAssets
from ultralytics import YOLO
download_assets(VideoAssets.PEOPLE_WALKING)
model = YOLO('yolov8x-seg.pt')
frames_generator = sv.get_video_frames_generator(source_path='people-walking.mp4')
frames_iterator = iter(frames_generator)
frame = next(frames_iterator)
result = model.track(frame)[0]
detections = sv.Detections.from_ultralytics(result)
round_box_annotator = sv.RoundBoxAnnotator()
annotated_frame = round_box_annotator.annotate(scene=frame.copy(), detections=detections)
sv.plot_image(image=annotated_frame, size=(12, 12))
|
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
cc @SkalskiP I did checks and write docs parts and also made collab part for testing so can you also check and upload the image to server so it can show up as well. |
@onuralpszr, can we make the name a bit shorter? I was thinking about |
Okay let me handle it but you also please handle image for me (upload for docs collab already ready) |
@SkalskiP rename done. And test code and collab also changed as well. |
sv.RoundBoundingBoxAnnotator
which annotates bounding box with round edgessv.RoundBoxAnnotator
which annotates bounding box with round edges
Signed-off-by: Onuralp SEZER <thunderbirdtr@gmail.com>
Thanks to @capjamesg's help he uploaded the pictures for docs so I am merging. Thank you all ! |
Description
This annotator will draw a bounding box which has round edges based on
roundness
attribute which accepts float values <roundness
<= 1.0.By default, roundness attribute percentage value is calculated based on the smaller size dimension (width or height). For example if height < width, and roundness is 1.0, the height dimension will be rounded completely.
This PR implements issue #693. (Fix #693)
Execution time of annotation process (tested on Ryzen 7 5800H):
No new dependencies required for this change.
I tested annotation results on walking people demo video. I used YOLOv8 to get the detection results. Screenshot of demo, using
roundness = 0.5
, is presented below:Any specific deployment considerations
Docs
Docs not updated. Need to be updated with new annotator.