Train Detector on MS COCO (trainvalno5k 2014) dataset - Sudhakar17/darknet GitHub Wiki

Train Detector on MS COCO (trainvalno5k 2014) dataset

Note: For using Mosaic data augmentation and to avoid the bottleneck of CPU performance for data augmentation, compile Darknet with OpenCV.

Required files:

classes= 80
train  = <replace with your path>/trainvalno5k.txt
valid = <replace with your path>/testdev2017.txt
names = data/coco.names
backup = backup
eval=coco

Training

Note: The results in the paper were obtained using training on 1 GPU (all parameters in yolov4.cfg by default, except for width=512 height=512)

  • Training command:

./darknet detector train cfg/coco.data cfg/yolov4.cfg csdarknet53-omega.conv.105

  • Continue training:

./darknet detector train cfg/coco.data cfg/yolov4.cfg backup/yolov4_last.weights

You will get files

  • chart.png with Loss chart
  • backup/yolov4_last.weights - trained last weights file
  • backup/yolov4_final.weights - trained final weights file (when training is complete)

Detection:

Detect on the image:

./darknet detector test cfg/coco.data cfg/yolov4.cfg backup/yolov4_final.weights dog.jpg -ext_output

Detect on the video-file:

./darknet detector demo cfg/coco.data cfg/yolov4.cfg backup/yolov4_final.weights test.mp4 -ext_output

Detect on the video-file by using GPU-1:

./darknet detector demo cfg/coco.data cfg/yolov4.cfg backup/yolov4_final.weights test.mp4 -ext_output -i 1

Detect on the RTSP/HTTP video-camera:

./darknet detector demo cfg/coco.data cfg/yolov4.cfg backup/yolov4_final.weights http://192.168.0.80:8080/video?dummy=param.mjpg -ext_output