Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

There seems to be a bug when opening the annotation file and visually adjust the size and location of the previously labeled bboxes? #18

Closed
George-Zhu opened this issue Sep 14, 2016 · 7 comments

Comments

@George-Zhu
Copy link

George-Zhu commented Sep 14, 2016

Hi @tzutalin ~ This labeling tool is pretty convenient and I like it very much! However, when I click the "open annotation" button, open a previously saved xml file and try to adjust the size and location of the bbox visually, the shape of the bboxes are no longer rectangles. Maybe there is a bug here.

I did this because I wanted to use CNN to pre-label the bboxes so that we can just make some adjustment, which can reduce the workload.

I 'm looking forward to your reply : )

@George-Zhu George-Zhu changed the title There seems to be a bug when open the annotation file and visually adjust the size and location of the previously labeled bboxes! There seems to be a bug when opening the annotation file and visually adjust the size and location of the previously labeled bboxes! Sep 14, 2016
@George-Zhu George-Zhu changed the title There seems to be a bug when opening the annotation file and visually adjust the size and location of the previously labeled bboxes! There seems to be a bug when opening the annotation file and visually adjust the size and location of the previously labeled bboxes? Sep 15, 2016
@George-Zhu
Copy link
Author

I have fixed the bug by modifying the Line 121 of pascal_voc_io.py as following:
points = [(xmin,ymin), (xmin,ymax), (xmax, ymax), (xmax, ymin)] -->
points = [(xmin, ymin), (xmax, ymin), (xmax, ymax), (xmin, ymax)]

Anyway, thanks a lot :)

@tzutalin
Copy link
Contributor

Hi @George-Zhu ,
Can you share me with the examples which have problems? Or do you think it is ok to use the below changes without side effect?
points = [(xmin,ymin), (xmin,ymax), (xmax, ymax), (xmax, ymin)] -->
points = [(xmin, ymin), (xmax, ymin), (xmax, ymax), (xmin, ymax)]

@nkhdiscovery
Copy link
Contributor

@George-Zhu Thanks for the fix! Saved my day!
@tzutalin @George-Zhu : I wonder why is this caused during parsing the xml with wrong order of points, I guessed there was an issue with the type of shape or something, then I found this solution and wondered, can you explain the cause?

@nkhdiscovery
Copy link
Contributor

@tzutalin You can just load an image, annotate, save and then close the project. ( I did this with Open Dir and set the default annotation folder). Close it and re-open with Open Dir, then try to edit rectangles ... you'll see that it fails to keep the aspect ratio and messes the box.

@tzutalin
Copy link
Contributor

tzutalin commented Nov 6, 2016

HI @nkhdiscovery ,
If you modify the Line 121 of pascal_voc_io.py as following, that can fix your the issue, right?
points = [(xmin,ymin), (xmin,ymax), (xmax, ymax), (xmax, ymin)] -->
points = [(xmin, ymin), (xmax, ymin), (xmax, ymax), (xmin, ymax)]

@nkhdiscovery
Copy link
Contributor

Hi @tzutalin ,
Yes it worked, I'm using it right now.
Great work by the way :)
I will spend a pull request if I improved anything, but not for this issue right now as I still have not figured the reason well.

Actually, I think this has no further harm as I had a quick review of the code, changing this line makes the order clock-wise and later in adding these points to shape and building the canvas (which is handled by Qt I guess), the resulting canvas would be obviously treated differently.
I let you know more if I figured it completely.

@tzutalin
Copy link
Contributor

tzutalin commented Nov 7, 2016

@nkhdiscovery ,
Very appreciated ! I am looking forward to your PR!!!!

tzutalin added a commit that referenced this issue Nov 8, 2016
This fixes #18 where openning previous annotation files causes a bug …
arnavkohli added a commit to arnavkohli/labelImg that referenced this issue Apr 16, 2021
…uses a bug in resizing bounding boxes, they were not rectangle anymore and could become deformed.
arnavkohli added a commit to arnavkohli/labelImg that referenced this issue Apr 16, 2021
…sue#18

This fixes HumanSignal#18 where openning previous annotation files causes a bug …
captainfffsama pushed a commit to captainfffsama/labelImg that referenced this issue Nov 7, 2022
…uses a bug in resizing bounding boxes, they were not rectangle anymore and could become deformed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants