luxonis / depthai-ml-training

Some Example Neural Models that we've trained along with the training scripts
MIT License
118 stars 32 forks source link

Update YoloV7_training.ipynb #34

Closed orgicus closed 1 year ago

orgicus commented 1 year ago

Hello there,

I've recently tried to make a custom yolov7 dataset based on this notebook (moving forward from the VOC conversion) and unfortunately lost a bit of time because a crucial little detail wasn't visible: the annotion bounding box is in <object-class-id> <center-x> <center-y> <width> <height> format.

This was already present in the notebook: 2022-12-25 19_24_08-https___raw githubusercontent com_luxonis_depthai-ml-training_master_colab-noteb

However it never got rendered on github: 2022-12-25 19_18_32-depthai-ml-training_YoloV7_training ipynb at master · luxonis_depthai-ml-trainin (perhaps the < and > symbols make the annotation details line turn into HTML tags or ignored).

This trivial PR simply swapt < for [ and > for ] so the line renders: 2022-12-25 19_36_50-depthai-ml-training_YoloV7_training ipynb at yolov7-annotations-notes · orgicus_

(I found information pointing to the fact that the values are normalised, but it was unclear wether the format is 'xmin', 'xmax', 'ymin', 'ymax' format, etc. The info on the official repo wasn't clear on this either. In hind sight this line: x, y, w, h = (box[0] + box[1]) / 2.0 - 1, (box[2] + box[3]) / 2.0 - 1, box[1] - box[0], box[3] - box[2] in convert_label explains the same, but I missed it. Hopefully this helps others looking for the info in a hurry)