Setting up YOLO with Darknet


Hello! In this tutorial I will show you how to setup YOLO with Darknet.

What is YOLO?

YOLO (You Only Look Once) is a single stage detector that is popular due to it's speed and accuracy, it has been used in various applications to detect people, animals, traffic signals etc.

There are other object detectors such as R-CNN however, they are not as reliable as YOLO.

In this tutorial we will be building YOLOv3, v3 is significantly larger than previous models but it is the best one to use.

What is Darknet?

Darknet is an open source neural network framework written in C and CUDA. It is fast, easy to install, and supports CPU and GPU computation.

Setting up YOLO with Darknet

First we need to install darknet

git clone && cd darknet

Next we need to download the pre-trained weights


Or you can use the following bash script:

Now we can try out the detector on the sample images provided in the repository.

./darknet detector test cfg/ cfg/yolov3.cfg yolov3.weights data/horses.jpg

If all goes well you should see the predictions in the terminal, there will also be a file called "predictions.jpg" which when opened should look something like the below image:


Making the detection faster with GPU

You can get the same results but with much faster time by enabling the GPU flag. To do this just modify the Makefile.


Then rerun make



In this tutorial I have shown how to setup Yolo with Darknet. I am currently interested in yolov4 👀

If you have any cool sample/projects please share. 😃

Like me work? I post about a variety of topics, if you would like to see more please like and follow me. Also I love coffee.

“Buy Me A Coffee”