Skip to content

magicshuang/yolov5_distillation

 
 

Repository files navigation

yolov5 知识蒸馏

介绍

yolov5-l模型压缩至yolov5-s 压缩算法是 https://github.com/twangnh/Distilling-Object-Detectors

Quick Start Examples

Install

Python >= 3.6.0 required with all requirements.txt dependencies installed:

$ git clone https://github.com/magicshuang/yolov5_distillation
$ cd magicshuang/yolov5_distillation
$ pip install -r requirements.txt
Training

没有teacher模型的人,先训练teacher模型

$ python train.py --data coco.yaml --cfg yolov5s.yaml --weights '' --batch-size 64
                                         yolov5m                                40
                                         yolov5l                                24
                                         yolov5x                                16
Distillation Training
$ python Distill_train.py --data coco.yaml --teacher-weights [your path] --batch-size 64
  

详细了解

比yolov5源码只多了两个文件 Distill_train.py & utils/distill_fun.py

所以可以直接下载这两个文件就可以了

About

YOLOv5 🚀 in PyTorch > ONNX > CoreML > TFLite

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.0%
  • Shell 1.2%
  • Dockerfile 0.8%