How sproc01/branchyyolo works
Project Type and Purpose
• This is a deep learning object detection project, specifically implementing a variant of the YOLO architecture – BranchyYOLO – which introduces a two-branch topology for detecting table game pieces. Additionally, it includes an ablated version of YOLOv9-C used for comparative studies.
• The project leverages PyTorch and depends on an external YOLOv9 implementation for some of its functionality.
Analyzing the File Structure
• Top-Level Files:
• Files like run.py, Detection.ipynb, and yaml configuration files (BranchyYOLO.yaml, AblatedYOLOv9-C.yaml, hyp.yaml, coco.yaml) are the backbone of training, testing, and configuration.
• README.md and Report.pdf provide project documentation and details.
• Directory “Model”:
• Contains separate directories for BranchyYOLO and AblatedYOLOv9-C, each with subdirectories for training (e.g., Train_synthetic, Train_synthetic_real) holding the best trained model weights.
• Other Files:
• The Jupyter Notebook (Detection.ipynb) indicates a usage context where users might perform object detection, pointing to an end-to-end pipeline from training to inference.
• This structure suggests a design where different model definitions (configured by separate YAML files) are trained and evaluated with common pipelines (run.py).
Architectural Components
a. Model Definitions:
• BranchyYOLO model (defined in BranchyYOLO.yaml) and AblatedYOLOv9-C model (defined in AblatedYOLOv9-C.yaml).
b. Training Pipeline:
• run.py acts as the orchestration layer to train and test models.
• Configuration files: hyp.yaml (hyperparameters) and coco.yaml (dataset configuration).
c. Data Input / Dataset:
• The dataset is referenced via coco.yaml. Note that the actual dataset isn’t included, but it’s integral to the system's function.
d. Inference Pipeline:
• Detection.ipynb for running object detection in images, likely using the trained model weights.
e. Model Weights Storage:
• The Model directory stores the different trained model snapshots for both the BranchyYOLO and Ablated YOLO versions.
f. External Dependencies:
• PyTorch and the officially referenced YOLOv9 implementation are key dependencies used in the training and model building process.
• Data Layer: Represent datasets and configuration (coco.yaml).
• Training Engine: Denote run.py which controls the training process and tests. Include sub-components like data loading, pre-processing, forward/backward pass, and evaluation.
• Hyperparameter and Configuration Manager: Represent hyp.yaml as a module feeding configuration details.
• Inference: Include a separate component for Detection.ipynb which illustrates detection/inference flow.
• Branching from run.py into two separate training workflows (one for BranchyYOLO and one for the ablated variant), then converging into model evaluation and inference.
• Notes on Architectural Patterns:
• That the design follows a modular deep learning pipeline pattern with clear separation between model definition, training, and inference.
• That the abstraction allows for easy swapping and comparison between different model topologies (BranchyYOLO vs. AblatedYOLOv9-C).