A repository for my studies on implementing YOLOv3 and using it on the Berkeley Deep Drive dataset.
- Run
git clone https://github.com/lykius/bdd-yolo.git
- Navigate inside the new directory named "bdd-yolo"
- Create a new Python3 virtual environment with the command
python3 -m venv venv
- Activate the new virtual environment with
source venv/bin/activate
- Run
pip3 install -r requirements.txt
to install all the needed libraries
- Create an account here: https://bdd-data.berkeley.edu/login.html
- Access the download page (https://bdd-data.berkeley.edu/portal.html#download)
- Click on the "Images" button to download a 6.5 GB zip file called "bdd100k_images.zip"
- Click on the "Labels" button to download an other archive called "bdd100k_labels_release.zip"
- Place both the zip files in a directory "archives" inside the directory "bdd-yolo" created in the section above
- Navigate inside the directory "bdd-yolo"
- Run
python3 dataset_prep.py
. This will:- Unzip the two archives and rearrange files and directories
- Resize images from 1280x720 to 416x256 (the size has been chosen to be multiple of 32)
- Create files with the lists of training, validation and test images
- Create one labels file for every training and validation image
If everything went fine, you can run python3 dataset_test.py
and see one image at a time of the validation set (with bounding boxes and labels taken from the dataset info).
Alternatively, you can play around with jupyter notebook bdd.ipynb
.
The repository contains an implementation of Darknet (YOLOv3), made in python with the framework PyTorch. The program loads the network architecture and the weights from two files:
bdd.cfg
with the network architecture and other configuration parametersbdd.weights
with the weights for all the network parameters
The first is already inside the directory yolo/cfg
.
The second can be downloaded from mediafire or from google drive. After downloading it, place it in the directory yolo/cfg
.
Weights have been generated by training the official version of darknet (https://github.com/pjreddie/darknet) for a week on the Berkeley Deep Drive dataset (prepared as described above).
To test the network, just run python3 darknet_test.py
and the program will forward one image at a time of the validation set through the darknet implementation. Predictions will be printed out and displayed on the processed image.
It is also possible to use the jupyter notebook darknet.ipynb
.