This project was written both as a learning experience and to make hacking on YOLO easier than the alternative C framework.
Use conda for easiest setup
conda env create -f environment.yml
conda activate darktorch
Required packages if not using conda:
- pytorch
- torchvision
- opencv-python
Optional packages:
- visdom
- matplotlib
- pytest
# Download weights
wget https://pjreddie.com/media/files/yolov2.weights
# Run detect script
python3 detect.py --weights=yolov2.weights --cfg=cfg/yolov2.cfg --image=data/dog.jpg
# Downloads weights
wget https://pjreddie.com/media/files/yolov3-voc.weights
# Or for CPU use VOC-TINY
wget https://pjreddie.com/media/files/yolov3-tiny.weights
# Webcam demo
## CPU
python3 webcam_demo.py --no-cuda
## IF you have Nvidia CUDA
python3 webcam_demo.py
# Run detect script
python3 detect.py --weights=yolov2-voc.weights --cfg=cfg/yolov2-voc.cfg --image=data/dog.jpg
# Download VOC dataset
cd data
cp ../scripts/get_voc_dataset.sh ./
bash get_voc_dataset.sh
# Label VOC dataset
cp ../../scripts/voc_label.py
python3 voc_label.py
cd ../..
python3 train.py
# Download COCO dataset
cd data
cp ../scripts/get_coco_dataset.sh ./
bash get_coco_dataset.sh
cd ..
python3 train.py --cfg=cfg/yolov2-coco.cfg --weights=darknet19_448.conv.23
- --no-cuda
- --num-workers
- --clipping-norm
- --cfg
- --data
- --weights
- --no-shuffle
- --non-random
- --fintune
- --once
# From the root directory run:
cd data
cp ../scripts/get_voc_dataset.sh ./
cp ../scripts/get_coco_dataset.sh ./
bash get_voc_dataset.sh
cd ..
bash get_coco_dataset.sh
cd ..
# Run the label VOC script
cd voc
cp ../../scripts/voc_label.py
python3 voc_label.py
cd ../..
# Run the test suite
python3 -m pytest
@misc{darknet13,
author = {Joseph Redmon},
title = {Darknet: Open Source Neural Networks in C},
howpublished = {\url{http://pjreddie.com/darknet/}},
year = {2013--2016}
}