AlexeyAB / darknet

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )
http://pjreddie.com/darknet/
Other
21.65k stars 7.96k forks source link

How To Custom Train using COCO dataset? #6218

Open mck0517 opened 4 years ago

mck0517 commented 4 years ago

I want to train only 6 classes (person, bicycle, car, motorbike, bus, truck) in the coco dataset.

  1. The coco.names file has been modified as follows. person bicycle car motorbike bus truck

  2. The coco.data file was modified as follows. classes= 6 train = /home/ckmoon/work_object_detection/darknet/scripts/coco/trainvalno5k.txt valid = /home/ckmoon/work_object_detection/darknet/scripts/testdev2017.txt names = /home/ckmoon/work_object_detection/darknet/cfg/coco.names backup = backup eval=coco

  3. After downloading csdarknet53-omega_final.weights, the file csdarknet53-omega.conv.105 was obtained.

  4. The classes and filters of yolov4.cfg file were modified as follows for all three parts. [convolutional] filters=33 #(6+5)*3

[yolo] classes=6

  1. I tried training using the following command, but a problem occurred. ./darknet detector train cfg/coco.data cfg/yolov4.cfg csdarknet53-omega.conv.105

스크린샷, 2020-07-13 11-40-21

lsd1994 commented 4 years ago

You shoule change lables first to fit your custom dataset. For example, class "bus" has id = 5 in coco dataset, but you should change it to id = 4 in all labels of coco, because id of bus is 4 in your case.