developer0hye / Yolo_Label

GUI for marking bounded boxes of objects in images for training neural network YOLO
MIT License
490 stars 114 forks source link

some image coords are not being saved #36

Closed fm64hylian closed 4 years ago

fm64hylian commented 4 years ago

I have hundreds of images correctly being saved but there's these 2 jpg images where no matter how I save, the coords are not being added to the txt file: error1 error2

for some reason, only the, percentages? are being saved. These two images are the only ones where this is happening. I tried with another 600 images(jpg and png) and both fields are being saved. What could it be?

Thank you

developer0hye commented 4 years ago

@fm64hylian Can you send me these files?

fm64hylian commented 4 years ago

sorry for the late reply. these are the files:

carrot_0120 carrot_0106

I'm running a script to resize some images using opencv, I don't know if that could be the cause

developer0hye commented 4 years ago

@fm64hylian what size do you resize?

fm64hylian commented 4 years ago

it's not a small size, those are the resized images^, my script will only resize in half if the image is over 1000px, so a image will never be smaller than 500px. My darknet model resizes at 416px anyway

developer0hye commented 4 years ago

https://github.com/developer0hye/Yolo_Label/blob/e002e18a1663c8c9b0a5548d4a2fc38649bd18e3/label_img.cpp#L56-L57

Look at the above condition, if your bounding box is too small, the box would not be saved. Can you check this?

fm64hylian commented 4 years ago

I'm really sorry, I was mistaking the labelling format with a different labelling tool, other tools label like 0 214 332 145 423 etc and I was getting mixed formats when saving the labels, so it is labelling correctly.

Unfortunately, I cannot check on my laptop because the insufficient resolution issue, but thanks.

the code is the same btw:

bool width_is_too_small     = objBoundingbox.box.width() * m_inputImg.width()  < 4;
bool height_is_too_small    = objBoundingbox.box.height() * m_inputImg.height() < 4;

Sorry for the misunderstanding.

developer0hye commented 4 years ago

@fm64hylian It's okay~!