supervision icon indicating copy to clipboard operation
supervision copied to clipboard

Add annotator RoundBoundingBoxAnnotator which has rectangle with round edges

Open xaristeidou opened this issue 1 year ago • 2 comments

Search before asking

  • [X] I have searched the Supervision issues and found no similar feature requests.

Description

I have created a new annotator class named RoundBoundingBoxAnnotator which draws bounding box with rounded edges.

RoundBoundingBoxAnnotator has the same attributes with BoundingBoxAnnotator including one extra attribute roundness which accepts float values 0 < roundness <= 1.0. Roundness attribute controls the percentage of edge roundness based each time on the lower length of width or height, for each object independently.

You can see some examples with roundness = 0.5 and roundess = 1.0 in the following screenshots.

round_box_annotator = sv.RoundBoundingBoxAnnotator(thickness=2, roundess=0.5) roundness_05

round_box_annotator = sv.RoundBoundingBoxAnnotator(thickness=2, roundess=1.0) roundness_1

I have created two different cases of RoundBoundingBoxAnnotator. The first one has the same color and thickness for edges and lines of the box. The second one can accept different values for color and thickness. You can view a demo video for each case below.

I think this annotator look cool and could be included in Supervision API. I can't decide which one looks better or if extra feature for different color and thickness of edges and lines is too much or not. Let me know your thoughts.

https://github.com/roboflow/supervision/assets/65918758/c5c21ec5-79b1-483b-9b66-36b098b11ee2

https://github.com/roboflow/supervision/assets/65918758/76150e2f-e743-41f7-bf3b-810bfbe4e0d9

Use case

No response

Additional

No response

Are you willing to submit a PR?

  • [X] Yes I'd like to help by submitting a PR!

xaristeidou avatar Dec 25 '23 23:12 xaristeidou

Hello once again @xaristeidou 👋🏻 ! I like this idea very much. If you have the code ready, open PR I would love to see.

SkalskiP avatar Dec 28 '23 09:12 SkalskiP

@SkalskiP I have submitted PR for the annotator in #702 .

xaristeidou avatar Dec 29 '23 17:12 xaristeidou