AlexeyAB/darknet

★ 22,144⑂ 0

YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )

22,144Star
0Fork
0Watch
0Issue
CLanguage
-License
Created · last push · repository size 0 KB · default branch -

README

Yolo v4, v3 and v2 for Windows and Linux

(neural networks for object detection)

---- ---- ----

YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors

YOLOv7 is more accurate and faster than YOLOv5 by 120% FPS, than YOLOX by 180% FPS, than Dual-Swin-T by 1200% FPS, than ConvNext by 550% FPS, than SWIN-L by 500% FPS, than PPYOLOE-X by 150% FPS.

YOLOv7 surpasses all known object detectors in both speed and accuracy in the range from 5 FPS to 160 FPS and has the highest accuracy 56.8% AP among all known real-time object detectors with 30 FPS or higher on GPU V100, batch=1.

----

more5

----

image

----

More details in articles on medium:

Manual: https://github.com/AlexeyAB/darknet/wiki

Discussion:

About Darknet framework: http://pjreddie.com/darknet/

Darknet Continuous Integration CircleCI Contributors License: Unlicense DOI arxiv.org arxiv.org colab colab

Darknet Logo

scaled_yolov4 AP50:95 - FPS (Tesla V100) Paper: https://arxiv.org/abs/2011.08036

----

modern_gpus AP50:95 / AP50 - FPS (Tesla V100) Paper: https://arxiv.org/abs/2004.10934

tkDNN-TensorRT accelerates YOLOv4 ~2x times for batch=1 and 3x-4x times for batch=4.

GeForce RTX 2080 Ti

| Network Size | Darknet, FPS (avg) | tkDNN TensorRT FP32, FPS | tkDNN TensorRT FP16, FPS | OpenCV FP16, FPS | tkDNN TensorRT FP16 batch=4, FPS | OpenCV FP16 batch=4, FPS | tkDNN Speedup | |:--------------------------:|:------------------:|-------------------------:|-------------------------:|-----------------:|---------------------------------:|-------------------------:|--------------:| |320 | 100 | 116 | 202 | 183 | 423 | 430 | 4.3x | |416 | 82 | 103 | 162 | 159 | 284 | 294 | 3.6x | |512 | 69 | 91 | 134 | 138 | 206 | 216 | 3.1x | |608 | 53 | 62 | 103 | 115 | 150 | 150 | 2.8x | |Tiny 416 | 443 | 609 | 790 | 773 | 1774 | 1353 | 3.5x | |Tiny 416 CPU Core i7 7700HQ | 3.4 | - | - | 42 | - | 39 | 12x |

Youtube video of results

| [Yolo v4](https://youtu.be/1_SiUOYUoOI "Yolo v4") | [Scaled Yolo v4](https://youtu.be/YDFf-TqJOFE "Scaled Yolo v4") | |---|---|

Others: https://www.youtube.com/user/pjreddie/videos

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 tasks and replace the paths with yours: https://raw.githubusercontent.com/AlexeyAB/darknet/master/scripts/testdev2017.txt 3. Download yolov4.weights file 245 MB: yolov4.weights (Google-drive mirror yolov4.weights ) 4. Content of the file cfg/coco.data should be

classes= 80
train  = /trainvalno5k.txt
valid = /testdev2017.txt
names = data/coco.names
backup = backup
eval=coco

5. Create /results/ folder near with ./darknet executable file 6. Run validation: ./darknet detector valid cfg/coco.data cfg/yolov4.cfg yolov4.weights 7. Rename the file /results/coco_results.json to detections_test-dev2017_yolov4_results.json and compress it to detections_test-dev2017_yolov4_results.zip 8. 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 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:

./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights test.mp4 -dont_show -ext_output ./darknet detector demo cfg/coco.data cfg/yolov4.cfg yolov4.weights test.mp4 -benchmark

Pre-trained models

There are weights-file for different cfg-files (trained for MS COCO dataset):

FPS on RTX 2070 (R) and Tesla V100 (V):

just change width= and height= parameters in yolov4-csp.cfg file and use the same yolov4-csp.weights file for all cases: just change width= and height= parameters in yolov4.cfg file and use the same yolov4.weights file for all cases:
CLICK ME - Yolo v3 models

CLICK ME - Yolo v2 models
  • yolov2.cfg (194 MB COCO Yolo v2) - requires 4 GB GPU-RAM: https://pjreddie.com/media/files/yolov2.weights
  • yolo-voc.cfg (194 MB VOC Yolo v2) - requires 4 GB GPU-RAM: http://pjreddie.com/media/files/yolo-voc.weights
  • yolov2-tiny.cfg (43 MB COCO Yolo v2) - requires 1 GB GPU-RAM: https://pjreddie.com/media/files/yolov2-tiny.weights
  • yolov2-tiny-voc.cfg (60 MB VOC Yolo v2) - requires 1 GB GPU-RAM: http://pjreddie.com/media/files/yolov2-tiny-voc.weights
  • yolo9000.cfg (186 MB Yolo9000-model) - requires 4 GB GPU-RAM: http://pjreddie.com/media/files/yolo9000.weights

Put it near compiled: darknet.exe

You can get cfg-files by path: darknet/cfg/

Requirements for Windows, Linux and macOS

Yolo v4 in other frameworks

Official TF models: https://github.com/tensorflow/models/tree/master/official/vision/beta/projects/yolo For YOLOv4 - convert yolov4.weights/cfg files to yolov4.pb by using TNTWEN project, and to yolov4.tflite TensorFlow-lite

More Image Trending projects

1
2

Comfy-Org / ComfyUI

Python★ 133,239⑂ 0
3

opencv / opencv

C++★ 90,840⑂ 0
4
5

d2l-ai / d2l-zh

Python★ 80,681⑂ 0
6

unslothai / unsloth

Python★ 76,181⑂ 0