# shanmukh-villuri/yolo-3d architecture

> Architecture diagram of the GitHub repository shanmukh-villuri/yolo-3d, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shanmukh-villuri/yolo-3d
- Repository: https://github.com/shanmukh-villuri/yolo-3d

## Overview

YOLO-3D processes video or webcam frames into tracked detections, metric depth, pseudo-3D boxes and a meter-scaled Bird’s Eye View, then writes annotated video and per-object distances to CSV. `run.py` coordinates the main workflow; detection, depth estimation and 3D visualization are implemented in separate modules. The README documents the depth-association and output capabilities. Some `run.py` implementation is omitted, so edges involving those stages rely on its indexed references or README documentation; optional camera calibration is shown without an unverified connection.

Main entry points: [`run.py`](https://github.com/shanmukh-villuri/yolo-3d/blob/main/run.py) (Frame orchestrator), [`bbox3d_utils.py`](https://github.com/shanmukh-villuri/yolo-3d/blob/main/bbox3d_utils.py) (3D box estimator), [`detection_model.py`](https://github.com/shanmukh-villuri/yolo-3d/blob/main/detection_model.py) (YOLO detection), [`depth_model.py`](https://github.com/shanmukh-villuri/yolo-3d/blob/main/depth_model.py) (Metric depth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Frame workflow"]
  node_runner["Frame orchestrator<br/>[run.py]"]
  node_association["Depth association<br/>[run.py]"]
  node_camera["Camera calibration"]
end

subgraph group_models["Inference models"]
  node_detector["YOLO detection<br/>[detection_model.py]"]
  node_depth["Metric depth<br/>[depth_model.py]"]
end

subgraph group_visuals["3D visualization"]
  node_estimator["3D box estimator<br/>[bbox3d_utils.py]"]
  node_boxrender["Box rendering<br/>[bbox3d_utils.py]"]
  node_bev["Meter-scaled BEV<br/>[bbox3d_utils.py]"]
end

node_user(("Video or webcam"))
node_video["Annotated video"]
node_distances["Distance CSV"]

node_user -->|"supplies frames"| node_runner
node_runner -->|"detects and tracks"| node_detector
node_runner -->|"estimates depth"| node_depth
node_runner -->|"samples depth"| node_association
node_association -->|"builds 3D boxes"| node_estimator
node_runner -->|"cleans trackers"| node_estimator
node_runner -->|"renders annotations"| node_boxrender
node_runner -->|"adds BEV overlay"| node_bev
node_runner -->|"writes frames"| node_video
node_runner -->|"logs distances"| node_distances

click node_runner "https://github.com/shanmukh-villuri/yolo-3d/blob/main/run.py"
click node_detector "https://github.com/shanmukh-villuri/yolo-3d/blob/main/detection_model.py"
click node_depth "https://github.com/shanmukh-villuri/yolo-3d/blob/main/depth_model.py"
click node_association "https://github.com/shanmukh-villuri/yolo-3d/blob/main/run.py"
click node_estimator "https://github.com/shanmukh-villuri/yolo-3d/blob/main/bbox3d_utils.py"
click node_boxrender "https://github.com/shanmukh-villuri/yolo-3d/blob/main/bbox3d_utils.py"
click node_bev "https://github.com/shanmukh-villuri/yolo-3d/blob/main/bbox3d_utils.py"
click node_camera "https://github.com/shanmukh-villuri/yolo-3d/blob/main/load_camera_params.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_runner,node_association,node_camera toneBlue
class node_detector,node_depth toneAmber
class node_estimator,node_boxrender,node_bev toneMint
class node_user,node_video,node_distances toneIndigo
```

## Components

### Frame workflow

- [Frame orchestrator](https://github.com/shanmukh-villuri/yolo-3d/blob/main/run.py): `run.py`
- [Depth association](https://github.com/shanmukh-villuri/yolo-3d/blob/main/run.py): `run.py`
- [Camera calibration](https://github.com/shanmukh-villuri/yolo-3d/blob/main/load_camera_params.py): `load_camera_params.py`

### Inference models

- [YOLO detection](https://github.com/shanmukh-villuri/yolo-3d/blob/main/detection_model.py): `detection_model.py`
- [Metric depth](https://github.com/shanmukh-villuri/yolo-3d/blob/main/depth_model.py): `depth_model.py`

### 3D visualization

- [3D box estimator](https://github.com/shanmukh-villuri/yolo-3d/blob/main/bbox3d_utils.py): `bbox3d_utils.py`
- [Box rendering](https://github.com/shanmukh-villuri/yolo-3d/blob/main/bbox3d_utils.py): `bbox3d_utils.py`
- [Meter-scaled BEV](https://github.com/shanmukh-villuri/yolo-3d/blob/main/bbox3d_utils.py): `bbox3d_utils.py`

### Other components

- **Video or webcam**
- **Annotated video**
- **Distance CSV**

## Connections

- Video or webcam → Frame orchestrator: supplies frames (evidence: `README.md`)
- Frame orchestrator → YOLO detection: detects and tracks (evidence: `run.py`)
- Frame orchestrator → Metric depth: estimates depth (evidence: `run.py`)
- Frame orchestrator → Depth association: samples depth (evidence: `README.md`)
- Depth association → 3D box estimator: builds 3D boxes (evidence: `README.md`)
- Frame orchestrator → 3D box estimator: cleans trackers (evidence: `run.py`)
- Frame orchestrator → Box rendering: renders annotations (evidence: `README.md`)
- Frame orchestrator → Meter-scaled BEV: adds BEV overlay (evidence: `README.md`)
- Frame orchestrator → Annotated video: writes frames (evidence: `run.py`)
- Frame orchestrator → Distance CSV: logs distances (evidence: `run.py`)
