Skip to content

Conversation

Vlczech
Copy link

@Vlczech 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
@Vlczech Vlczech changed the title Scaled polygon (point, rectangle, circle) labels Fix: Scaled polygon (point, rectangle, circle) labels (= no hidding labels) Aug 11, 2025
@Vlczech
Copy link
Author

Vlczech commented Aug 21, 2025

@wkentaro

@wkentaro
Copy link
Owner

wkentaro commented Aug 21, 2025

so the issue is like:

  1. keep_prev is on
  2. you annotate an image
  3. you scale in the image
  4. you go to the next image
  5. the copied shape is not correct scale

@Vlczech
Copy link
Author

Vlczech commented Aug 21, 2025

@wkentaro

Scenario:

  1. yes, keep previous annotation is on and fit window is activated also
  2. as you wrote
  3. not needed step - fit window is activated, but it is not needed to, i think - the annotation is out of the picture also
  4. as you wrote
  5. maybe? In my words: if first image is much higher than second, then previous annotations are hidden "somewhere right or down or both" (depends on where annotation is drawn) - so you need to unzoom image and find an annotation somewhere.

Previous behavior:
image

New one if proportions of image are same:
image

@Vlczech
Copy link
Author

Vlczech commented Aug 29, 2025

@wkentaro : So, what do you think?

@wkentaro
Copy link
Owner

@Vlczech let me find time to reproduce the issue and review this.

@wkentaro
Copy link
Owner

wkentaro commented Aug 31, 2025

@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.mp4

So I guess your problem would be with images whose dimensions are different, which is outside of the original intent.
What scenario do you use this and encounter a difficulty in your use case?

@Vlczech
Copy link
Author

Vlczech commented Sep 1, 2025

@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)

@Vlczech
Copy link
Author

Vlczech commented Sep 1, 2025

@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.

@wkentaro
Copy link
Owner

wkentaro commented Sep 2, 2025

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.

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

Successfully merging this pull request may close these issues.

2 participants