YOLOv5 Optimization Doc

Environment Setup

Quick start

Note

Some methods only works on YOLOv5’s backbone (ex: NAS). We then map the new structured backbone back to construct a new detection model.

Test one-shot NAS on YOLOv5’s backbone

$ python oneshot_nas.py

Test multi-trial NAS on YOLOv5

$ python hello_nas.py

Test pruning on YOLOv5’s backbone

$ python pruning.py

Test Iterative pruning on YOLOv5

$ bash iterative_pruning.sh

Test Knowledge Distillation on YOLOv5 (Soft targets)

$ python train.py --data coco.yaml --epochs 101 --weights "./checkpoint/student.pt" --t_weights "./checkpoint/teacher.pt"

Test Feature Distillation on YOLOv5

$ python train.py --data coco.yaml --epochs 101 --weights "./checkpoint/student.pt" --ft_weights "./checkpoint/teacher.pt"

Optimization Tutorial

This project managed several optimization methods on YOLOv5, including:

Optimization API

Common Issues

Experiment Results

Note

  • Baseline is the result of YOLOv5s train 100 epochs from scratch.

  • Every model in the result is an optimized YOLOV5s and is trained for 100 epochs from scratch.

  • NAS v1 and v2 (ex: DARTs_v1, DARTs_v2) differs from search space. v2 has larger search space than v1.

_images/Final_Result.png