Introduction
This directory contains PyTorch YOLOv3 software developed by Ultralytics LLC, and is freely available for redistribution under the GPL-3.0 license. For more information please visit https://www.ultralytics.com.
Description
The https://github.com/ultralytics/yolov3 repo contains inference and training code for YOLOv3 in PyTorch. The code works on Linux, MacOS and Windows. Training is done on the COCO dataset by default: https://cocodataset.org/#home. Credit to Joseph Redmon for YOLO: https://pjreddie.com/darknet/yolo/.
Requirements
Python 3.7 or later with all of the pip install -U -r requirements.txt
packages including:
torch >= 1.4
opencv-python
Pillow
All dependencies are included in the associated docker images. Docker requirements are:
- Nvidia Driver >= 440.44
- Docker Engine - CE >= 19.03
Tutorials
Jupyter Notebook
Our Jupyter notebook provides quick training, inference and testing examples.
Training
Start Training: python3 train.py
to begin training after downloading COCO data with data/get_coco_dataset.sh
. Each epoch trains on 117,263 images from the train and validate COCO sets, and tests on 5000 images from the COCO validate set.
Resume Training: python3 train.py --resume
to resume training from weights/last.pt
.
Plot Training: from utils import utils; utils.plot_results()
plots training results from coco_16img.data
, coco_64img.data
, 2 example datasets available in the data/
folder, which train and test on the first 16 and 64 images of the COCO2014-trainval dataset.
Image Augmentation
datasets.py
applies random OpenCV-powered (https://opencv.org/) augmentation to the input images in accordance with the following specifications. Augmentation is applied only during training, not during inference. Bounding boxes are automatically tracked and updated with the images. 416 x 416 examples pictured below.
Augmentation