# arezyhs/cv-final-project architecture

> Architecture diagram of the GitHub repository arezyhs/cv-final-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arezyhs/cv-final-project
- Repository: https://github.com/arezyhs/cv-final-project

## Overview

This repository runs a reproducible BDD100K road-object detection experiment, comparing Selective Search + HOG + Linear SVM with a HOG-LBP variant. The main workflow is dataset preparation, manifest splitting, crop generation, feature/model training, inference, validation threshold selection, and evaluation; optional download and test stages are also documented. The graph includes EDA and experiment reporting as supporting capabilities. Relationships follow the sampled orchestrator and source references; unsampled implementation details are not assumed.

Main entry points: [`src/run_pipeline.py`](https://github.com/arezyhs/cv-final-project/blob/master/src/run_pipeline.py) (Pipeline runner), [`src/train_svm.py`](https://github.com/arezyhs/cv-final-project/blob/master/src/train_svm.py) (SVM training), [`src/predict.py`](https://github.com/arezyhs/cv-final-project/blob/master/src/predict.py) (Selective Search inference), [`src/build_training_data.py`](https://github.com/arezyhs/cv-final-project/blob/master/src/build_training_data.py) (Training crops)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Dataset preparation"]
  node_download["Dataset download"]
  node_manifest["Manifest and splits<br/>[make_manifest.py]"]
  node_training_data["Training crops"]
end

subgraph group_model["Modeling and inference"]
  node_features["HOG / LBP features<br/>[features.py]"]
  node_training["SVM training<br/>[train_svm.py]"]
  node_models[("Saved models")]
  node_inference["Selective Search inference<br/>[predict.py]"]
end

subgraph group_analysis["Analysis and evaluation"]
  node_eda["Data analysis<br/>[eda.py]"]
  node_tuning["Threshold tuning<br/>[tune_inference.py]"]
  node_evaluation["Detection evaluation<br/>[evaluate.py]"]
  node_visualization["Detection visualization"]
  node_summary["Result summaries"]
  node_experiment_log["Experiment log<br/>[experiment_log.py]"]
end

subgraph group_orchestration["Experiment orchestration"]
  node_config["Experiment config"]
  node_pipeline["Pipeline runner<br/>[run_pipeline.py]"]
end

node_researcher(("Researcher"))
node_bdd["BDD100K / KaggleHub"]

node_researcher -->|"runs experiment"| node_pipeline
node_pipeline -->|"loads settings"| node_config
node_pipeline -->|"optionally downloads"| node_download
node_download -.->|"fetches subset"| node_bdd
node_pipeline -->|"creates splits"| node_manifest
node_download -->|"builds manifests"| node_manifest
node_pipeline -->|"builds crops"| node_training_data
node_training_data -->|"reads annotations"| node_manifest
node_pipeline -->|"analyzes data"| node_eda
node_pipeline -->|"trains models"| node_training
node_training -->|"extracts features"| node_features
node_training -.->|"reads crop samples"| node_training_data
node_training -.->|"saves models"| node_models
node_pipeline -->|"runs inference"| node_inference
node_inference -->|"extracts features"| node_features
node_inference -.->|"loads models"| node_models
node_pipeline -->|"tunes thresholds"| node_tuning
node_tuning -->|"scores candidates"| node_evaluation
node_pipeline -->|"evaluates detections"| node_evaluation
node_evaluation -->|"uses IoU"| node_training_data
node_pipeline -->|"renders detections"| node_visualization
node_pipeline -->|"summarizes results"| node_summary
node_pipeline -->|"records runs"| node_experiment_log
node_pipeline -.->|"optionally tests"| node_inference

click node_config "https://github.com/arezyhs/cv-final-project/blob/master/configs/project_config.yaml"
click node_download "https://github.com/arezyhs/cv-final-project/blob/master/src/download_dataset.py"
click node_manifest "https://github.com/arezyhs/cv-final-project/blob/master/src/make_manifest.py"
click node_training_data "https://github.com/arezyhs/cv-final-project/blob/master/src/build_training_data.py"
click node_eda "https://github.com/arezyhs/cv-final-project/blob/master/src/eda.py"
click node_features "https://github.com/arezyhs/cv-final-project/blob/master/src/features.py"
click node_training "https://github.com/arezyhs/cv-final-project/blob/master/src/train_svm.py"
click node_models "https://github.com/arezyhs/cv-final-project/tree/master/models"
click node_inference "https://github.com/arezyhs/cv-final-project/blob/master/src/predict.py"
click node_tuning "https://github.com/arezyhs/cv-final-project/blob/master/src/tune_inference.py"
click node_evaluation "https://github.com/arezyhs/cv-final-project/blob/master/src/evaluate.py"
click node_visualization "https://github.com/arezyhs/cv-final-project/blob/master/src/visualize_detections.py"
click node_summary "https://github.com/arezyhs/cv-final-project/blob/master/src/summarize_results.py"
click node_experiment_log "https://github.com/arezyhs/cv-final-project/blob/master/src/experiment_log.py"
click node_pipeline "https://github.com/arezyhs/cv-final-project/blob/master/src/run_pipeline.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_download,node_manifest,node_training_data toneBlue
class node_features,node_training,node_models,node_inference toneAmber
class node_eda,node_tuning,node_evaluation,node_visualization,node_summary,node_experiment_log toneMint
class node_config,node_pipeline toneRose
class node_researcher,node_bdd toneIndigo
```

## Components

### Dataset preparation

- [Dataset download](https://github.com/arezyhs/cv-final-project/blob/master/src/download_dataset.py): `src/download_dataset.py`
- [Manifest and splits](https://github.com/arezyhs/cv-final-project/blob/master/src/make_manifest.py): `src/make_manifest.py`
- [Training crops](https://github.com/arezyhs/cv-final-project/blob/master/src/build_training_data.py): `src/build_training_data.py`

### Modeling and inference

- [HOG / LBP features](https://github.com/arezyhs/cv-final-project/blob/master/src/features.py): `src/features.py`
- [SVM training](https://github.com/arezyhs/cv-final-project/blob/master/src/train_svm.py): `src/train_svm.py`
- [Saved models](https://github.com/arezyhs/cv-final-project/tree/master/models): `models`
- [Selective Search inference](https://github.com/arezyhs/cv-final-project/blob/master/src/predict.py): `src/predict.py`

### Analysis and evaluation

- [Data analysis](https://github.com/arezyhs/cv-final-project/blob/master/src/eda.py): `src/eda.py`
- [Threshold tuning](https://github.com/arezyhs/cv-final-project/blob/master/src/tune_inference.py): `src/tune_inference.py`
- [Detection evaluation](https://github.com/arezyhs/cv-final-project/blob/master/src/evaluate.py): `src/evaluate.py`
- [Detection visualization](https://github.com/arezyhs/cv-final-project/blob/master/src/visualize_detections.py): `src/visualize_detections.py`
- [Result summaries](https://github.com/arezyhs/cv-final-project/blob/master/src/summarize_results.py): `src/summarize_results.py`
- [Experiment log](https://github.com/arezyhs/cv-final-project/blob/master/src/experiment_log.py): `src/experiment_log.py`

### Experiment orchestration

- [Experiment config](https://github.com/arezyhs/cv-final-project/blob/master/configs/project_config.yaml): `configs/project_config.yaml`
- [Pipeline runner](https://github.com/arezyhs/cv-final-project/blob/master/src/run_pipeline.py): `src/run_pipeline.py`

### Other components

- **Researcher**
- **BDD100K / KaggleHub**

## Connections

- Researcher → Pipeline runner: runs experiment (evidence: `README.md`)
- Pipeline runner → Experiment config: loads settings (evidence: `src/run_pipeline.py`)
- Pipeline runner → Dataset download: optionally downloads (evidence: `src/run_pipeline.py`)
- Dataset download → BDD100K / KaggleHub: fetches subset
- Pipeline runner → Manifest and splits: creates splits (evidence: `src/run_pipeline.py`)
- Dataset download → Manifest and splits: builds manifests (evidence: `src/download_dataset.py`)
- Pipeline runner → Training crops: builds crops (evidence: `src/run_pipeline.py`)
- Training crops → Manifest and splits: reads annotations (evidence: `src/build_training_data.py`)
- Pipeline runner → Data analysis: analyzes data (evidence: `src/run_pipeline.py`)
- Pipeline runner → SVM training: trains models (evidence: `src/run_pipeline.py`)
- SVM training → HOG / LBP features: extracts features (evidence: `src/train_svm.py`)
- SVM training → Training crops: reads crop samples
- SVM training → Saved models: saves models
- Pipeline runner → Selective Search inference: runs inference (evidence: `src/run_pipeline.py`)
- Selective Search inference → HOG / LBP features: extracts features (evidence: `src/predict.py`)
- Selective Search inference → Saved models: loads models
- Pipeline runner → Threshold tuning: tunes thresholds (evidence: `src/run_pipeline.py`)
- Threshold tuning → Detection evaluation: scores candidates (evidence: `src/tune_inference.py`)
- Pipeline runner → Detection evaluation: evaluates detections (evidence: `src/run_pipeline.py`)
- Detection evaluation → Training crops: uses IoU (evidence: `src/evaluate.py`)
- Pipeline runner → Detection visualization: renders detections (evidence: `src/run_pipeline.py`)
- Pipeline runner → Result summaries: summarizes results (evidence: `src/run_pipeline.py`)
- Pipeline runner → Experiment log: records runs (evidence: `src/run_pipeline.py`)
- Pipeline runner → Selective Search inference: optionally tests (evidence: `README.md`)
