This is the code from the March 2018 Lancaster AI talk on Yolo v2
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Thanks for coming to the page. Be sure to check out info on the March 2018 Lancaster AI meetup for more info about this code and a video.

Read more about YOLO (in darknet) and download weight files here.


You will need to install Python3, OpenCV 3.3 or higher, natsort, pickle and any missing libraries I forgot. I'd HIGHLY recommend having CUDA 9.0+, cuDNN 7+ installed as well.

PLEASE NOTE: I am using Python3 in a virtual environment, which is why I can use the 'python blah' command to run my code versus 'python3 blah'. If you run into problems running the 'python' commands in these examples, try using 'python3' in its place or learn to use a virtualenv, which is the better way.

This is not a small task. Getting all of these installed and working correctly can take a whole night of your life, so plan accordingly. You CAN just use them without the CUDA and cuDNN, which will shave a bunch of time (and save your lifeforce). Just remember the performance won't be great, and PyTorch and Darknet original versions give you the best FPS on a Mac.

Getting started

Install the frameworks you want to work with. Here is the listing again:

Darknet (Original) .

AlexeyAB (Windows/Linux): .

PyYolo - Python Wrapper on C .

Darkflow - Tensorflow .

PyTorch-Yolo2 - + many more .

Caffee-Yolo - Outdated :( -

Place the stuff in right folders, i.e. backup goes into backup. If the folder doesn't exist, just create it. This is based on the original darkflow filesystem.

You should be able to follow all the steps in the presentation video.

Parsing the commands

You may not be able to see the commands in the video, so here is what I used.

On Darknet original install:

Detect Image:

./darknet detector test cfg/ cfg/tiny-yolo-voc.cfg backup/tiny-yolo-voc.weights data/dog.jpg


./darknet detector demo cfg/ cfg/tiny-yolo-voc.cfg backup/tiny-yolo-voc.weights


python cfg/tiny-yolo-voc.cfg tiny-yolo-voc.weights


./flow --model cfg/tiny-yolo-voc.cfg --load backup/tiny-yolo-voc.weights --demo camera

Customizing your own objects

Here's a great blog post on the process.

RectLabel - Pay the man, and then label your items. You'll need to add your object in settings first, load your folder, and then go crazy labeling. Remember the 'command-I' if you're doing a lot. It helps. If you're on a Linux or Windows machine, and want to, you can use Yolo_Mark

VOC_Label, convert pixel annotations to Yolo percentage annotations:

python -p training/JackSkellington

Process training and test files (copy to same directory as images, without annotations folder in it):


Validate - AlexeyAb:

./darknet detector map data/ cfg/skellington.cfg backup/skellington_1000.weights
./darknet detector map data/ cfg/skellington.cfg backup/skellington_4000.weights

Jack Skellington Demo - PyTorch .

You need to copy the file I included into your PyTorch Yolo2 folder. It has some quick changes to lower the threshold and pull the proper .data file.

python cfg/skellington.cfg backup/skellington_4000.weights

I think that's about it. You should be able to figure out how to do your own custom objects from this. Feel free to post an issue if you run into any challenges.