Skip to content
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

[LabelAnnotator, RichLabelAnnotator, VertexLabelAnnotator] - add smart label positioning #1383

Open
SkalskiP opened this issue Jul 19, 2024 · 3 comments
Labels
api:annotator Annotators enhancement New feature or request

Comments

@SkalskiP
Copy link
Collaborator

SkalskiP commented Jul 19, 2024

Description

Overlapping labels are a common issue, especially in crowded scenes. Let's add an optional smart label positioning feature to the LabelAnnotator, RichLabelAnnotator, and VertexLabelAnnotator that:

  • Ensures that the label box does not extend beyond the image.
  • Automatically adjust the position of overlapping labels to prevent them from overlapping.

IMG_0062FC89843B-1

The algorithm boils down to locating overlapping label boxes and then calculating the direction of vectors to push the labels apart. This process may require an iterative approach, as moving label boxes can lead to new overlaps with other label boxes.

IMG_8FB8BD194AE1-1

Importantly, the bounding box remains in the same place, only the label boxes are moved. It would be great if, after the shift, the label and its original position were connected by a line.

Examples of incorrect behavior

image (85)

download - 2024-04-25T171410 778

Examples of expected behavior

vertex-label-annotator-v1-optimized.mp4

Here's the Google Colab I used to experiment with this feature.

Additional

  • Note: Please share a Google Colab with minimal code to test the new feature. We know it's additional work, but it will speed up the review process. The reviewer must test each change. Setting up a local environment to do this is time-consuming. Please ensure that Google Colab can be accessed without any issues (make it public). Thank you! 🙏🏻
@SkalskiP SkalskiP added the enhancement New feature or request label Jul 19, 2024
@Bhavay-2001
Copy link
Contributor

Hi @SkalskiP, could you pls describe the issue a little more and also can i take this issue?

@SkalskiP SkalskiP added the api:annotator Annotators label Jul 19, 2024
@SkalskiP
Copy link
Collaborator Author

Hi @Bhavay-2001 👋🏻 I recommend doing this first: #1384

@jeslinpjames
Copy link
Contributor

Hey, @SkalskiP

I'd like to try working on this. Could you provide any specific guidelines or tips for implementing this feature?

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

No branches or pull requests

3 participants