WongKinYiu / ScaledYOLOv4

Scaled-YOLOv4: Scaling Cross Stage Partial Network
GNU General Public License v3.0
2.02k stars 575 forks source link

how to train on VOC dataset? #8

Open infinite013 opened 3 years ago

WongKinYiu commented 3 years ago

Example of YOLOv4-large:

  1. Follow Training YOLO on VOC to prepare VOC data.
  2. Follow coco.data to create voc.data.
  3. add argument --data data/voc.data when training.
SpongeBab commented 3 years ago

@WongKinYiu @infinite013 Now I can confirm @WongKinYiu are wrong. The YOLO format is not same as before(it also mean is not the same as yolov4 ) (Yolo-CSP copy the code of YOLOv5 of the https://github.com/ultralytics/yolov5.and it is the author of yolov3. It's has the different dataset format :) now:

Each row is class x_center y_center width height format.

The https://pjreddie.com/darknet/yolo/ make the VOC dataset with:

<object-class> <x> <y> <width> <height>

Although it can train and no error. But it is wrong as i show at https://github.com/WongKinYiu/ScaledYOLOv4/issues/205

x_center y_center width height format. is a relavtive coordinate. <x> <y> <width> <height>is the absolute coordinate.

WongKinYiu commented 3 years ago

no, the https://pjreddie.com/darknet/yolo/ make the VOC dataset with relative coordinate.

https://github.com/AlexeyAB/darknet/blob/master/scripts/voc_label.py#L12-L23

SpongeBab commented 3 years ago

@WongKinYiu The https://pjreddie.com/darknet/yolo/ make the VOC dataset with relative coordinate. It does. But when the image is flipped, the angle is changed, and various mosaic enhancements are performed, the values ​​of x and y do not seem to change correctly. Just like the train_batch0 picture shows.


I'm wrong.I think this is a kind of mosaic enhancements.I trained 300 and get good detections.