-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Fix: Scaled polygon (point, rectangle, circle) labels (= no hidding labels) #1614
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
base: main
Are you sure you want to change the base?
Conversation
Vlczech
commented
Aug 11, 2025
- for the same aspect ratios polygon labels are scaled in the same proportion to the change in size
- for different aspect ratios polygon labels keep absolute position if it does not exceed image size
- if polygon label exceed image size, polygon labels are moved to left top corner
* for the same aspect ratios polygon labels are scaled in the same proportion to the change in size * for different aspect ratios polygon labels keep absolute position if it does not exceed image size * if polygon label exceed image size, polygon labels are moved to left top corner
so the issue is like:
|
Scenario:
|
@wkentaro : So, what do you think? |
@Vlczech let me find time to reproduce the issue and review this. |
@Vlczech "Keep previous labels" is designed to annotate video. Example: https://github.com/wkentaro/labelme/tree/main/examples/video_annotation#video-annotation-example And zooming doesn't seem to be a problem in this example: FocuSee.Project.2025-08-31.3-37-47.PM_1.mp4So I guess your problem would be with images whose dimensions are different, which is outside of the original intent. |
@wkentaro : Yes, you are right- My problems are with images (more precisely, for example, the folder with images in it), as I showed on example in one of previous comment. But I'm convinced, that my fix for basic shapes does not interfere with video behavior in any way (because the video has the same aspect ratio, but this is also taken into account for images) |
@wkentaro: An scenario is following: there is set of images, where similar objects are in the pictures and are approximately in the same space (template alignment). But because images are taken by multiple people with different mobile devices, so there is also different resolution of images. The worst variant is, when first image has the highest resolution and every other image has lower resolution (then the right down graphic labels/annotations are "hidden"). So my fix solve this problem by maintaining the same ratio in annotations as resolution changes. If resolution change is not in same ratio, annotation keep same absolute position (current behavior) if it is not outside of image, else annotation is placed on top left corner to avoid finding hidden annotation. |
I see. now I understand your use case. I'll try mimicking your use case (by cropping images in a video), and better understand what the code is intended to do. |