# reiner-11/fit_vision_webcam architecture

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

- Interactive diagram: https://gitdiagram.com/reiner-11/fit_vision_webcam
- Repository: https://github.com/reiner-11/fit_vision_webcam

## Overview

Fitness Motion is a webcam exercise-tracking app: a user selects an exercise, the app captures frames, detects pose keypoints, counts completed reps, and displays angle, form cues, and FPS. Exercise-specific angle thresholds and cues are implemented separately from pose inference. The repository also supports obtaining pose-training data and evaluating trained models. Edges reflect the sampled source and README; training is documented as an external Ultralytics CLI workflow, and unsampled details are not inferred.

Main entry points: [`src/main.py`](https://github.com/reiner-11/fit_vision_webcam/blob/main/src/main.py) (Webcam app and HUD), [`evaluate.py`](https://github.com/reiner-11/fit_vision_webcam/blob/main/evaluate.py) (Model evaluator), [`live_check.py`](https://github.com/reiner-11/fit_vision_webcam/blob/main/live_check.py) (Live environment check), [`src/inference.py`](https://github.com/reiner-11/fit_vision_webcam/blob/main/src/inference.py) (Pose inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_live["Live tracking"]
  node_app["Webcam app and HUD<br/>[main.py]"]
  node_pose["Pose inference<br/>[inference.py]"]
end

subgraph group_logic["Exercise analysis"]
  node_exercise["Rep and form logic<br/>[exercises.py]"]
end

subgraph group_data["Model data and evaluation"]
  node_downloader["Dataset downloader"]
  node_dataset["Pose datasets"]
  node_weights["Pose weights"]
  node_evaluator["Model evaluator<br/>[evaluate.py]"]
  node_metrics["Evaluation outputs"]
end

subgraph group_check["Runtime checks"]
  node_checker["Live environment check<br/>[live_check.py]"]
end

node_user(("Exerciser"))
node_camera(("Webcam"))
node_yolo["Ultralytics YOLO"]
node_roboflow["Roboflow"]
node_trainer["Ultralytics pose trainer"]

node_user -->|"selects exercise"| node_app
node_camera -->|"provides frames"| node_app
node_app -->|"predicts and extracts"| node_pose
node_pose -->|"runs inference"| node_yolo
node_app -->|"updates state"| node_exercise
node_app -->|"shows HUD"| node_user
node_downloader -->|"downloads from"| node_roboflow
node_downloader -->|"writes export"| node_dataset
node_dataset -->|"training input"| node_trainer
node_trainer -->|"produces weights"| node_weights
node_weights -->|"loads model"| node_app
node_evaluator -->|"evaluates split"| node_dataset
node_evaluator -->|"runs model"| node_yolo
node_evaluator -->|"writes reports"| node_metrics
node_checker -->|"reuses app helpers"| node_app
node_checker -->|"checks inference"| node_pose
node_checker -->|"checks rep logic"| node_exercise

click node_app "https://github.com/reiner-11/fit_vision_webcam/blob/main/src/main.py"
click node_pose "https://github.com/reiner-11/fit_vision_webcam/blob/main/src/inference.py"
click node_exercise "https://github.com/reiner-11/fit_vision_webcam/blob/main/src/exercises.py"
click node_downloader "https://github.com/reiner-11/fit_vision_webcam/blob/main/download_dataset.py"
click node_dataset "https://github.com/reiner-11/fit_vision_webcam/tree/main/datasets"
click node_weights "https://github.com/reiner-11/fit_vision_webcam/tree/main/runs/pose"
click node_evaluator "https://github.com/reiner-11/fit_vision_webcam/blob/main/evaluate.py"
click node_metrics "https://github.com/reiner-11/fit_vision_webcam/tree/main/runs/pose"
click node_checker "https://github.com/reiner-11/fit_vision_webcam/blob/main/live_check.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_app,node_pose toneBlue
class node_exercise toneAmber
class node_downloader,node_dataset,node_weights,node_evaluator,node_metrics toneMint
class node_checker toneRose
class node_user,node_camera,node_yolo,node_roboflow,node_trainer toneIndigo
```

## Components

### Live tracking

- [Webcam app and HUD](https://github.com/reiner-11/fit_vision_webcam/blob/main/src/main.py): `src/main.py`
- [Pose inference](https://github.com/reiner-11/fit_vision_webcam/blob/main/src/inference.py): `src/inference.py`

### Exercise analysis

- [Rep and form logic](https://github.com/reiner-11/fit_vision_webcam/blob/main/src/exercises.py): `src/exercises.py`

### Model data and evaluation

- [Dataset downloader](https://github.com/reiner-11/fit_vision_webcam/blob/main/download_dataset.py): `download_dataset.py`
- [Pose datasets](https://github.com/reiner-11/fit_vision_webcam/tree/main/datasets): `datasets`
- [Pose weights](https://github.com/reiner-11/fit_vision_webcam/tree/main/runs/pose): `runs/pose`
- [Model evaluator](https://github.com/reiner-11/fit_vision_webcam/blob/main/evaluate.py): `evaluate.py`
- [Evaluation outputs](https://github.com/reiner-11/fit_vision_webcam/tree/main/runs/pose): `runs/pose`

### Runtime checks

- [Live environment check](https://github.com/reiner-11/fit_vision_webcam/blob/main/live_check.py): `live_check.py`

### Other components

- **Exerciser**
- **Webcam**
- **Ultralytics YOLO**
- **Roboflow**
- **Ultralytics pose trainer**

## Connections

- Exerciser → Webcam app and HUD: selects exercise
- Webcam → Webcam app and HUD: provides frames (evidence: `src/main.py`)
- Webcam app and HUD → Pose inference: predicts and extracts (evidence: `src/main.py`)
- Pose inference → Ultralytics YOLO: runs inference (evidence: `src/inference.py`)
- Webcam app and HUD → Rep and form logic: updates state (evidence: `src/main.py`)
- Webcam app and HUD → Exerciser: shows HUD
- Dataset downloader → Roboflow: downloads from (evidence: `download_dataset.py`)
- Dataset downloader → Pose datasets: writes export
- Pose datasets → Ultralytics pose trainer: training input
- Ultralytics pose trainer → Pose weights: produces weights
- Pose weights → Webcam app and HUD: loads model
- Model evaluator → Pose datasets: evaluates split (evidence: `evaluate.py`)
- Model evaluator → Ultralytics YOLO: runs model (evidence: `evaluate.py`)
- Model evaluator → Evaluation outputs: writes reports (evidence: `evaluate.py`)
- Live environment check → Webcam app and HUD: reuses app helpers (evidence: `live_check.py`)
- Live environment check → Pose inference: checks inference (evidence: `live_check.py`)
- Live environment check → Rep and form logic: checks rep logic (evidence: `live_check.py`)
