How brian891203/gold-yolo works
Project type and purpose
• This is an open-source deep-learning framework centered on “Gold-YOLO,” an efficient object‐detector built on top of YOLOv6.
• It provides training, self-distillation, evaluation, quantization and multi-platform deployment (ONNX, OpenVINO, TensorRT) pipelines.
File structure
• Top-level directories:
• configs: hyperparameter and architecture configurations for each Gold-YOLO variant
• data: dataset definitions (COCO, VOC), image folders and YAML paths
• gold_yolo: custom network modules (layers, common utilities, reppan, transformer)
• yolov6: underlying YOLOv6 implementation (assigners, core engine, data loaders, model definitions, utils)
• tools: CLI scripts for training, evaluation, inference, partial quantization, QAT, PPQ
• deploy: export and inference code for ONNX, OpenVINO, TensorRT (with subfolders for C++ and Python examples)
• docs: usage tutorials, speed tests, quantization guides
• Auxiliary files: assets (benchmark images/plots), requirements.txt, LICENSE, README.md
Extract insights from README
• Describes training workflows: base model → self-distillation
• Specifies multi-GPU distributed training, DFL mode, syncBN, fuse_ab
• Lists evaluation and benchmarking steps on COCO
• Links to deployment notebooks and code for each target runtime
Main components and their relationships
a. Data Ingestion & Preparation
• Components: data/ coco.yaml, voc.yaml, data loaders in yolov6/data
• Flow: Raw images + labels → Data augmenters → Batch tensors to Training Engine
b. Model Definition
• Components: gold_yolo/* (gather-and-distribute modules), yolov6/models (efficientrep, yolo head), layers
• Flow: Config-driven model instantiation → Forward/backward passes
c. Training & Distillation Pipeline
• Components: tools/train.py, yolov6/core/engine.py, core/solver/build.py
• Flow: Distributed-launch → Engine coordinates data → Model → Loss → Optimizer → Checkpoint
• Self-distillation: teacher_model_path flag triggers dual-model flow
d. Evaluation & Inference
• Components: tools/eval.py, tools/infer.py, yolov6/core/evaler.py, core/inferer.py
• Flow: Load checkpoint → Run validation on val split → Compute mAP
e. Quantization & Compression
• Components: tools/partial_quantization, tools/qat, tools/quantization/ppq, /tensorrt
• Flow: Post-training quantization scripts → Sensitivity analysis → Calibrator → QAT-aware quantization
f. Export & Deployment
• Components: deploy/ONNX (export_onnx, eval_trt, notebooks), deploy/OpenVINO/export_openvino.py, deploy/TensorRT/onnx_to_trt.py
• Flow: Export PyTorch model → Convert to ONNX → (optional) TensorRT builder → C++/Python inference demos
g. External services and hardware
• COCO/VOC datasets, Google Drive links for pre-trained weights
• GPU runtimes (T4-TRT7, TRT8), CMake builds for C++ demos
Architectural patterns and design principles
• Layered architecture:
• Data layer → Model layer → Training layer → Deployment layer
• Config-driven components: all hyperparameters and paths are injected via configs/*.py
• Plugin-style deployment: export scripts target different runtimes without changing core model code
• Reusability and extensibility: partial quantization and QAT modules decoupled from training core