WongKinYiu / ScaledYOLOv4

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

Map is different between darknet and pytorch #236

Open ShaneHsieh opened 3 years ago

ShaneHsieh commented 3 years ago

I use the same cfg & weights & valid dataset in darknet and pytorch.(yolov4-csp.cfg & yolov4-csp.weights & coco dataset val2017) But the result is different. what is cause this problem?

PS: I found the nms thresh is different.so I set the nms thresh to 0.45 that same the darkent (use --iou-thres 0.45 to set).

pytorch: python test.py --img 512 --conf 0.005 --batch 16 --device 0 --data coco.yaml --cfg yolov4-csp.cfg --weights yolov4-csp.weights --verbose --iou-thres 0.45

image

darknet: darknet detector map data\coco.data yolov4-csp.cfg yolov4-csp.weights

image

WongKinYiu commented 3 years ago

nms of darknet and pytorch are different. pytorch using batch nms while it is hard to implement in c.