Skip to content

Labels new edge can disappear #1818

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

Open
1 of 2 tasks
hidara2000 opened this issue Apr 9, 2025 · 3 comments
Open
1 of 2 tasks

Labels new edge can disappear #1818

hidara2000 opened this issue Apr 9, 2025 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@hidara2000
Copy link

Search before asking

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

Description

When using label annotator if the box is close to an edge and the text is on the edge side disappears off frame.

Add an option to ensure it stays fully in the frame

Use case

Suggested approach

in the .annotate function labels near the top can be moved inside the bounding box using something similar to

for i in range(label_properties.shape[0]):
     if label_properties[i, 1] < 0:
         spacing = 3
         offset = spacing + self.text_padding + self.font.size
         label_properties[i, :] = label_properties[i, :] + [0,offset,0,offset,0,0]

Additional

No response

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@hidara2000 hidara2000 added the enhancement New feature or request label Apr 9, 2025
@SkalskiP
Copy link
Collaborator

SkalskiP commented Apr 9, 2025

Hi @hidara2000 👋🏻! Thanks so much for your interest in supervision. Would you be interested in helping us implement this feature?

@hidara2000
Copy link
Author

#1820

@SkalskiP
Copy link
Collaborator

@hidara2000 responded ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants