supervision icon indicating copy to clipboard operation
supervision copied to clipboard

Enhance `sv.LabelAnnotator` by adding argument for round edges

Open xaristeidou opened this issue 11 months ago • 5 comments

Search before asking

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

Description

In sv.LabelAnnotator an attribute that will apply round edges to the label box can be added for prettier labels.

I have modified the annotator by adding an attribute: round_edges: bool = True

Screenshot from 2024-03-20 23-40-11

Use case

Better visualization results.

Additional

No response

Are you willing to submit a PR?

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

xaristeidou avatar Mar 20 '24 21:03 xaristeidou

Hi @xaristeidou 👋🏻 I think it's a cool idea, but I would replace round_edges with corner_radious.

SkalskiP avatar Mar 20 '24 21:03 SkalskiP

@SkalskiP So for corner_radius I assume that it will be integer and if the value is higher than the half of the lower dimension (height or width) of the box, it should be clipped?

xaristeidou avatar Mar 21 '24 08:03 xaristeidou

@SkalskiP Accidentally closed it.

xaristeidou avatar Mar 21 '24 08:03 xaristeidou

@xaristeidou

So for corner_radius I assume that it will be integer and if the value is higher than the half of the lower dimension (height or width) of the box, it should be clipped?

Exactly!

Accidentally closed it.

Don't worry, it happens to me all the time.

SkalskiP avatar Mar 21 '24 10:03 SkalskiP

@SkalskiP Ok, I will proceed with it and come back when ready.

xaristeidou avatar Mar 22 '24 08:03 xaristeidou

I close the issue, implemented in PR #1037

xaristeidou avatar Mar 25 '24 18:03 xaristeidou

Thanks for your help @xaristeidou 🙏🏻

SkalskiP avatar Mar 25 '24 22:03 SkalskiP