Giter VIP home page Giter VIP logo

gold-yolo's Introduction

Gold-YOLO: Efficient Object Detector via Gather-and-Distribute Mechanism

fps-trt7 fps-8

Benchmark

Model Size Self-Distill Pre-Train
Backbone
mAPval
0.5:0.95
Speed (fps)
T4-TRT7-FP16
bs1 / bs32
Speed (fps)
T4-TRT8-FP16
bs1 / bs32
Params
(M)
FLOPs
(G)
Weight
Gold-YOLO-N 640 39.9 563 / 1030 657 / 1191 5.6 12.1 Google Drive
cowtransfer
Gold-YOLO-S 640 46.4 286 / 446 308 / 492 21.5 46.0 Google Drive
cowtransfer
Gold-YOLO-M 640 51.1 152 / 220 157 / 241 41.3 87.5 Google Drive
cowtransfer
Gold-YOLO-L 640 53.3 88 / 116 94 / 137 75.1 151.7 Google Drive
cowtransfer

Table Notes

  • Results of the mAP and speed are evaluated on COCO val2017 dataset with the input resolution of 640×640.
  • Speed is tested with TensorRT 7.2 and TensorRT 8.5 on T4 GPU.

Environment

  • python requirements

    pip install -r requirements.txt
  • data:

    prepare COCO dataset, YOLO format coco labels and specify dataset paths in data.yaml

Train

Gold-YOLO-N

  • Step 1: Training a base model

    Be sure to open use_dfl mode in config file (use_dfl=True, reg_max=16)

    python -m torch.distributed.launch --nproc_per_node 8 tools/train.py \
    									--batch 128 \
    									--conf configs/gold_yolo-n.py \
    									--data data/coco.yaml \
    									--epoch 300 \
    									--fuse_ab \
    									--use_syncbn \
    									--device 0,1,2,3,4,5,6,7 \
    									--name gold_yolo-n
  • Step 2: Self-distillation training

    Be sure to open use_dfl mode in config file (use_dfl=True, reg_max=16)

    python -m torch.distributed.launch --nproc_per_node 8 tools/train.py \
    									--batch 128 \
    									--conf configs/gold_yolo-n.py \
    									--data data/coco.yaml \
    									--epoch 300 \
    									--device 0,1,2,3,4,5,6,7 \
    									--use_syncbn \
    									--distill \
    									--teacher_model_path runs/train/gold_yolo_n/weights/best_ckpt.pt \
    									--name gold_yolo-n

Gold-YOLO-S/M/L

  • Step 1: Training a base model

    Be sure to open use_dfl mode in config file (use_dfl=True, reg_max=16)

    python -m torch.distributed.launch --nproc_per_node 8 tools/train.py \
    									--batch 256 \
    									--conf configs/gold_yolo-s.py \ # gold_yolo-m/gold_yolo-l
    									--data data/coco.yaml \
    									--epoch 300 \
    									--fuse_ab \
    									--use_syncbn \
    									--device 0,1,2,3,4,5,6,7 \
    									--name gold_yolo-s # gold_yolo-m/gold_yolo-l
  • Step 2: Self-distillation training

    Be sure to open use_dfl mode in config file (use_dfl=True, reg_max=16)

    python -m torch.distributed.launch --nproc_per_node 8 tools/train.py \
    									--batch 256 \ # 128 for distillation of gold_yolo-l
    									--conf configs/gold_yolo-s.py \ # gold_yolo-m/gold_yolo-l
    									--data data/coco.yaml \
    									--epoch 300 \
    									--device 0,1,2,3,4,5,6,7 \
    									--use_syncbn \
    									--distill \
    									--teacher_model_path runs/train/gold_yolo-s/weights/best_ckpt.pt \
    									--name gold_yolo-s # gold_yolo-m/gold_yolo-l

Evaluation

python tools/eval.py --data data/coco.yaml --batch 32 --weights weights/Gold_s_pre_dist.pt --task val --reproduce_640_eval

Test speed

Please refer to Test speed

Acknowledgement

The implementation is based on YOLOv6, and some implementations borrowed from Topformer. Thanks for their open source code.

gold-yolo's People

Contributors

guan9wu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.