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

Allow Oriented Bounding Boxes to go out of the image margin #6820

Open
ViktorYu234 opened this issue Dec 23, 2024 · 1 comment
Open

Allow Oriented Bounding Boxes to go out of the image margin #6820

ViktorYu234 opened this issue Dec 23, 2024 · 1 comment

Comments

@ViktorYu234
Copy link

Hello,

I am utilizing Label Studio at my work and one of my tasks is it to label rotated rectangles in my images. For this task I'm utilizing Oriented Bounding Boxes. But there's one issue in Label-Studio which prevents me from doing my task properly:

Label-Studio does not allow OBB to go out of the image margin

This is an issue for me because sometimes there are rectangles which partially go out of bounds, forcing me to either mark them as a not oriented BB or to make them appear smaller as they actually are. But both solutions are rather bad for me because they may confuse the AI which needs to learn to mark even them properly.

Take this image as an example:

grafik

The minimal size of the rectangle can be determined as marked in the image, but labeling it properly is impossible without going out of the margin. I need to either not use oriented BB and include a big part of the background and mark it as not rotated, or make the labeled area smaller than it actually is (the label marked in the image doesn't even cover 1/3 of the actual rectangle).

I would like to be able to place at least one corner of the labeled area per image side out of the image margin to allow me to deal with issues like I described (Or rather in a way that each side of the label can't go fully out of image margin, but that might be not enough for other users who work with fully identical rectangles going out of bounds or so).

Actually I do not need an immediate update which implements this feature. If somebody can tell me the location of the code snippet which prevents me from moving my OBB out of bounds, I could change it for me by myself which would also be enough for me.

Can anyone help me?

@heidi-humansignal
Copy link
Collaborator

Hello,

I think it will require alot for you to change in LSO code snippet. It won't be just for the tool and it might cause some undesired behavior as well. Here is the file (https://github.com/HumanSignal/label-studio/blob/develop/web/libs/editor/src/components/ImageTransformer/ImageTransformer.jsx) and you are looking for dragBoundFunc method.

I would suggest the workaround as well.

  1. Alternative Workaround:
    As a temporary solution, you could pad your images with additional transparent or blank space around the edges before importing them into Label Studio. This would effectively increase the image dimensions, allowing you to annotate the full extent of objects that extend beyond the original margins.
  • Use an image editing tool or a script to add padding to your images.
  • Ensure that the annotations correspond correctly to the padded images for training your AI model.

Thank you,
Abu

Comment by Abubakar Saad
Workflow Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants