Closed SalahAdDin closed 3 years ago
Dear @SalahAdDin ,
The wrong boxes that RetinaNet is complaining about are that ones presenting negative coordinates. I have checked the conversion formulas in your code and they are right (lines 52 to 62). Please, look your XML files and give me a few examples of them presenting negative values for x_min
(I need the name of the image/txt file).
Best Regards
th
@thsant
Thanks,
Right now, i'm working in a way got ther which images presents this cases, because the warning is not enough verbosed to indicate us it.
I tried finding negative values in my ID, but i didn't get anything.
@SalahAdDin , I have downloaed your XMLs. The problem is happening for the instances CDY_2015,
SVB_1969 and SVB_1971. Numerical problems are creating negative values for x_min
(between -1 and 0 range).
Insert in your script something like:
x_min = max(x_min, 0)
before writing the XML.
@thsant There are other images with negative bounding boxes, why? if it is a numerical problem, does it mean the normalization was wrong? Can we trust in the other converted bounding boxes?
I did this update in order to avoid problems:
xmin = center_x - (bbox_width / 2)
ymin = center_y - (bbox_height / 2)
xmax = center_x + (bbox_width / 2)
ymax = center_y + (bbox_height / 2)
ET.SubElement(bbox, 'xmin').text = str(max(xmin,0))
ET.SubElement(bbox, 'ymin').text = str(max(ymin,0))
ET.SubElement(bbox, 'xmax').text = str(min(xmax,width))
ET.SubElement(bbox, 'ymax').text = str(min(ymax,height))
I don't think normalization is wrong - it's a sub-pixel error (values in the interval -1.0 to zero) caused by numerical problems when converting from the YOLO format to the VOC format. Bounding box was performed using tzutalin/labelImg (the tool is able to store YOLO and VOC formats). An alternative is using tzutalin/labelImg to convert from YOLO to VOC, but it is not necessary - a conversion script like yours should do the job. We have successfully used WGISD to train YOLOv2, YOLOv3 and Mask R-CNN. I know other user that has successfully trained YOLO again from scratch using the dataset.
Of course, you can check your XMLs in a viewer and see the annotated grapes.
@thsant Which Mask R-CNN implementation are you using? How did you train it?
I just found a ghost box in one image: https://github.com/thsant/wgisd/blob/master/data/SVB_20180427_151848752.txt#L6
@SalahAdDin Hi! I write to you here since in your wgisd forked repo issues are disabilitated. I was wondering if you tried to add in Pascal VOC format also polygon annotations from .npz files.
@SalahAdDin Hi! I write to you here since in your wgisd forked repo issues are disabilitated. I was wondering if you tried to add in Pascal VOC format also polygon annotations from .npz files.
Well, i don't know how i could do that, sorry.
I will enabled the issues and pull request there then.
Hello,
I'm testing this dataset, thank you for making it public, in order to compare it against different machine learning frameworks, and for making it easier to use in these, I tried to port this dataset to a more standard PASCAL VOC format.
Therefore, I made this script to port it. You can see my fork and see the results.
Unfortunately, when I test it with
RetinaNet
I get the next results:Unfortunately, I cannot guess which annotation files have these mistakes, which makes it so hard to discover the problem. Thas why I'm writing this issue.
I didn't test these results in other frameworks yet, but I can guess they will be problematic too.
Thanks