AlexeyAB / darknet

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

Are YOLOv4-P5 (896x896) and YOLOv4-P6 (1280x1280) described in the Scaled-YOLOv4 paper supported? If not, is it possible to add those? #7414

Open xjinai opened 3 years ago

xjinai commented 3 years ago

Are YOLOv4-P5 (896x896) and YOLOv4-P6 (1280x1280) described in the Scaled-YOLOv4 paper supported? If so, could you point me to the cfg and pre-trained weights files for YOLOv4-P5 and YOLOv4-P6? If not, is it possible to add the support of those?

stephanecharette commented 3 years ago

@AlexeyAB For those of us like myself only familiar with YOLOv4.cfg and YOLOv4-tiny.cfg, what is YOLOv4-p5.cfg and YOLOv4-p6.cfg you've recently added? What would be the guideline we should use to determine which configuration to use on a project?

AlexeyAB commented 3 years ago

@xjinai @stephanecharette

For Detection - use the same as usual:

./darknet detector test cfg/coco.data cfg/yolov4-p5.cfg yolov4-p5.weights -ext_output dog.jpg
./darknet detector test cfg/coco.data cfg/yolov4-p6.cfg yolov4-p6.weights -ext_output dog.jpg

You can download pre-trained weights on COCO:


For Training - change these lines before each of 3 for p5 (of 4 for p6) [yolo]-layers: https://github.com/AlexeyAB/darknet/blob/9a86fce494b1d82b774d36be76747fcb58f81aa4/cfg/yolov4-p5.cfg#L1810-L1811 filters=<(5 + num_classes) x 4> activation=logistic - for training and detection by using Darknet: https://github.com/AlexeyAB/darknet activation=linear - for training and detection by using Pytorch Scaled-YOLOv4 (CSP-branch): https://github.com/WongKinYiu/ScaledYOLOv4/tree/yolov4-csp

For training use pre-trained weights:

Currently Pytorch is more suitable for training on multiple-GPUs.


Accuracy - Speed:

Scaled-YOLOv4-P6 is slower, but +2% more accurate than YOLOR-P6 that is the best in terms of speed/accuracy for Waymo autonomous driving challenge: https://github.com/AlexeyAB/darknet/issues/7828

123036148-3e43a180-d3f5-11eb-926d-bbc810f0ea6a

Speed and accuracy on COCO is validated by using Pytorch: https://github.com/WongKinYiu/ScaledYOLOv4/tree/yolov4-csp 112776361-281d8380-9048-11eb-8083-8728b12dcd55 (1)