drainingsun/ybat

bboxes shifted position on their own

k00r opened this issue · 4 comments

k00r commented

Hello @drainingsun
First of all thank you for this glorious tool ^^
So i was using Boobs and having no issues whatsoever but a couple of days ago i annotated some images,saved them as YOLO format and closed the tool,a couple of hours later i realized i forgot to annotate an object and re-opened all the images and their annotation files just to realize some bounding boxes on an image,espacially the small ones shifted their position on the horizontal axis a bit,they weren't in their original position,note that i wasn't able to reproduce this issue it happened only once but as you might guess this can be a real pain if one is annotating a large dataset and constantly going back to check if the previous annotations are correct =/ what may be the cause of this? Any help is greatly appreciated.

Thank you!

As for the issue, if it happened once, it's weird. Did you by any chance use heavy zoom when annotating? Maybe some pixel rounding occured. I will investigate when I have time, but a sample image (I'm curious about it's size and object that's being annotated size) would be really helpful. Also OS and browser.

k00r commented

@drainingsun Yes,i used heavy zoom =/ I was also thinking about pixel rounding because while i annotated that particular image i saved the annotation file before the whole annotation process was complete,few days later i opened the file again and continued where i left off,this continued for several days and because of this some saving and reading occured without touching the previously annotated objects,this consecutive pixel rounding when saving the annotation file to the disk,if there is any,may have produced this major shifting of the bboxes on the image.Which part of the code does the rounding? Can you show? Oh,and i'm using Chrome on Win7 and the case image was a vertical image by the way,i can't remember the exact dimensions but it was around 9-10 megapixels,and yes the annotated objects were small =)

So, I tried debugging this. Used a 12MB image of 6k x 6k resolution. Multiple zoom variations and bbox sizes with many loads/saves of bboxes. I only got a very small shift on one of bboxes. The cause might have been a premature rounding (to lowest integer) of width and height when loading bboxes. I pushed a fix, but not sure if this was an actual cause. In any case, try it out, let me know. And if you can reliably reproduce the shift with your images, please provide me with the source material and the exact steps.

k00r commented

@drainingsun Alright,thank you :)