开源!适用于Win和Linux平台的YOLO4和YOLO3

Yolo-v4 and Yolo-v3/v2 for windows and linuxPaper Yolo v4: https://arxiv.org/abs/2004.10934
About Darknet framework: http://pjreddie.com/darknet/

开源!适用于Win和Linux平台的YOLO4和YOLO3

文章插图
 
tkDNN-TensorRT accelerates YOLOv4 ~2x times for batch=1 and 3x-4x times for batch=4. OpenCV-dnn is ~10% slower than tkDNN-TensorRT.
  • tkDNN: https://github.com/ceccocats/tkDNN
  • OpenCV: https://gist.github.com/YashasSamaga/48bdb167303e10f4d07b754888ddbdcf
GeForce RTX 2080 Ti:
开源!适用于Win和Linux平台的YOLO4和YOLO3

文章插图
 

开源!适用于Win和Linux平台的YOLO4和YOLO3

文章插图
 
How to evaluate AP of YOLOv4 on the MS COCO evaluation server
  1. Download and unzip test-dev2017 dataset from MS COCO server: http://images.cocodataset.org/zips/test2017.zip
  2. Download list of images for Detection taks and replace the paths with yours: https://raw.githubusercontent.com/AlexeyAB/darknet/master/scripts/testdev2017.txt
  3. Download yolov4.weights file: https://drive.google.com/open?id=1cewMfusmPjYWbrnuJRuKhPMwRe_b9PaT
  4. Content of the file cfg/coco.data should be
classes= 80train= <replace with your path>/trainvalno5k.txtvalid = <replace with your path>/testdev2017.txtnames = data/coco.namesbackup = backupeval=coco
  1. Create /results/ folder near with ./darknet executable file
  2. Run validation: ./darknet detector valid cfg/coco.data cfg/yolov4.cfg yolov4.weights
  3. Rename the file /results/coco_results.json to detections_test-dev2017_yolov4_results.json and compress it to detections_test-dev2017_yolov4_results.zip
  4. Submit file detections_test-dev2017_yolov4_results.zip to the MS COCO evaluation server for the test-dev2019 (bbox)
How to evaluate FPS of YOLOv4 on GPU
  1. Compile Darknet with GPU=1 CUDNN=1 CUDNN_HALF=1 OPENCV=1 in the Makefile (or use the same settings with Cmake)
  2. Download yolov4.weights file 245 MB: yolov4.weights (Google-drive mirror yolov4.weights )
  3. Get any .avi/.mp4 video file (preferably not more than 1920x1080 to avoid bottlenecks in CPU performance)
  4. Run one of two commands and look at the AVG FPS:
  • include video_capturing + NMS + drawing_bboxes: ./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights test.mp4 -dont_show -ext_output
  • exclude video_capturing + NMS + drawing_bboxes: ./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights test.mp4 -benchmark
Pre-trained modelsThere are weights-file for different cfg-files (trained for MS COCO dataset):
FPS on RTX 2070 (R) and Tesla V100 (V):
  • yolov4.cfg - 245 MB: yolov4.weights (Google-drive mirror yolov4.weights ) paper Yolo v4 just change width= and height= parameters in yolov4.cfg file and use the same yolov4.weights file for all cases:width=608 height=608 in cfg: 65.7% mAP@0.5 (43.5% AP@0.5:0.95) - 34(R) FPS / 62(V) FPS - 128.5 BFlopswidth=512 height=512 in cfg: 64.9% mAP@0.5 (43.0% AP@0.5:0.95) - 45(R) FPS / 83(V) FPS - 91.1 BFlopswidth=416 height=416 in cfg: 62.8% mAP@0.5 (41.2% AP@0.5:0.95) - 55(R) FPS / 96(V) FPS - 60.1 BFlopswidth=320 height=320 in cfg: 60% mAP@0.5 ( 38% AP@0.5:0.95) - 63(R) FPS / 123(V) FPS - 35.5 BFlops
  • yolov4-tiny.cfg - 40.2% mAP@0.5 - 371(1080Ti) FPS / 330(RTX2070) FPS - 6.9 BFlops - 23.1 MB: yolov4-tiny.weights
  • enet-coco.cfg (EfficientNetB0-Yolov3) - 45.5% mAP@0.5 - 55(R) FPS - 3.7 BFlops - 18.3 MB: enetb0-coco_final.weights
  • yolov3-openimages.cfg - 247 MB - 18(R) FPS - OpenImages dataset: yolov3-openimages.weights
CLICK ME - Yolo v3 modelsCLICK ME - Yolo v2 models
Put it near compiled: darknet.exe
You can get cfg-files by path: darknet/cfg/
Requirements