# ahmednawaz8813/myomotion architecture

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

- Interactive diagram: https://gitdiagram.com/ahmednawaz8813/myomotion
- Repository: https://github.com/ahmednawaz8813/myomotion

## Overview

MyoMotion is an early-stage strength-coaching prototype. Its implemented user workflow is to supply a deadlift video or webcam feed (or choose a synthetic scenario), detect pose landmarks, analyze movement and repetition phases, display form cues, and save a session summary and optionally annotated video. The repository also includes a separate sEMG session recorder and Arduino logger, but the sampled evidence does not establish a video–sEMG synchronization or fusion flow. Planned platform capabilities described in the README are not represented as implemented components here.

Main entry points: [`src/myomotion/biomechanics/deadlift_pipeline.py`](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/deadlift_pipeline.py) (Frame analyzer), [`scripts/demo_deadlift.py`](https://github.com/ahmednawaz8813/myomotion/blob/main/scripts/demo_deadlift.py) (Deadlift demo), [`src/myomotion/biomechanics/deadlift_angles.py`](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/deadlift_angles.py) (Kinematics), [`src/myomotion/biomechanics/deadlift_rules.py`](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/deadlift_rules.py) (Form rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and entry"]
  node_demo["Deadlift demo<br/>[demo_deadlift.py]"]
  node_pose["Pose tracking<br/>[pose.py]"]
  node_synthetic["Synthetic frames<br/>[synthetic.py]"]
  node_legacy["Legacy tracker"]
end

subgraph group_analysis["Biomechanics analysis"]
  node_analyzer["Frame analyzer"]
  node_filters["Signal filters<br/>[filters.py]"]
  node_landmarks["Landmark helpers<br/>[landmarks.py]"]
  node_angles["Kinematics<br/>[deadlift_angles.py]"]
  node_geometry["Geometry primitives<br/>[geometry.py]"]
  node_spine["Spine proxy<br/>[spine_proxy.py]"]
  node_segmenter["Rep phases<br/>[rep_segmenter.py]"]
  node_rules["Form rules<br/>[deadlift_rules.py]"]
end

subgraph group_feedback["Coaching output"]
  node_overlay["Visual feedback<br/>[overlay.py]"]
  node_results["Session files"]
end

subgraph group_emg["sEMG acquisition"]
  node_recorder["sEMG recorder<br/>[record_session.py]"]
  node_logger["EMG logger<br/>[emg_logger.ino]"]
end

node_athlete(("User"))

node_athlete -->|"provides video"| node_demo
node_demo -->|"requests landmarks"| node_pose
node_demo -->|"generates frames"| node_synthetic
node_demo -->|"analyzes frames"| node_analyzer
node_demo -->|"renders feedback"| node_overlay
node_demo -->|"writes summary/video"| node_results
node_legacy -->|"uses"| node_geometry
node_legacy -->|"uses"| node_landmarks
node_legacy -->|"uses"| node_segmenter
node_legacy -->|"uses"| node_filters
node_analyzer -->|"smooths signals"| node_filters
node_analyzer -->|"selects side"| node_landmarks
node_analyzer -->|"computes kinematics"| node_angles
node_analyzer -->|"uses proxy"| node_spine
node_analyzer -->|"tracks phases"| node_segmenter
node_analyzer -->|"evaluates form"| node_rules
node_angles -->|"uses primitives"| node_geometry
node_angles -->|"uses pose helpers"| node_landmarks
node_angles -->|"builds proxy"| node_spine
node_spine -->|"uses primitives"| node_geometry
node_spine -->|"uses pose helpers"| node_landmarks
node_segmenter -->|"uses filters"| node_filters
node_rules -->|"reads angles"| node_angles
node_rules -->|"reads phases"| node_segmenter
node_rules -->|"reads proxy"| node_spine
node_overlay -->|"reads results"| node_analyzer
node_overlay -->|"displays cues"| node_rules
node_recorder -.->|"acquires serial data"| node_logger

click node_demo "https://github.com/ahmednawaz8813/myomotion/blob/main/scripts/demo_deadlift.py"
click node_pose "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/vision/pose.py"
click node_synthetic "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/synthetic.py"
click node_legacy "https://github.com/ahmednawaz8813/myomotion/blob/main/scripts/cv/deadlift/deadlift_tracker.py"
click node_analyzer "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/deadlift_pipeline.py"
click node_filters "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/filters.py"
click node_landmarks "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/landmarks.py"
click node_angles "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/deadlift_angles.py"
click node_geometry "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/geometry.py"
click node_spine "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/spine_proxy.py"
click node_segmenter "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/rep_segmenter.py"
click node_rules "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/deadlift_rules.py"
click node_overlay "https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/coaching/overlay.py"
click node_recorder "https://github.com/ahmednawaz8813/myomotion/blob/main/scripts/semg/record_session.py"
click node_logger "https://github.com/ahmednawaz8813/myomotion/blob/main/hardware/emg_logger/emg_logger.ino"

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_demo,node_pose,node_synthetic,node_legacy,node_athlete toneBlue
class node_analyzer,node_filters,node_landmarks,node_angles,node_geometry,node_spine,node_segmenter,node_rules toneAmber
class node_overlay,node_results toneMint
class node_recorder,node_logger toneRose
```

## Components

### Capture and entry

- [Deadlift demo](https://github.com/ahmednawaz8813/myomotion/blob/main/scripts/demo_deadlift.py): `scripts/demo_deadlift.py`
- [Pose tracking](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/vision/pose.py): `src/myomotion/vision/pose.py`
- [Synthetic frames](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/synthetic.py): `src/myomotion/biomechanics/synthetic.py`
- [Legacy tracker](https://github.com/ahmednawaz8813/myomotion/blob/main/scripts/cv/deadlift/deadlift_tracker.py): `scripts/cv/deadlift/deadlift_tracker.py`

### Biomechanics analysis

- [Frame analyzer](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/deadlift_pipeline.py): `src/myomotion/biomechanics/deadlift_pipeline.py`
- [Signal filters](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/filters.py): `src/myomotion/biomechanics/filters.py`
- [Landmark helpers](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/landmarks.py): `src/myomotion/biomechanics/landmarks.py`
- [Kinematics](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/deadlift_angles.py): `src/myomotion/biomechanics/deadlift_angles.py`
- [Geometry primitives](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/geometry.py): `src/myomotion/biomechanics/geometry.py`
- [Spine proxy](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/spine_proxy.py): `src/myomotion/biomechanics/spine_proxy.py`
- [Rep phases](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/rep_segmenter.py): `src/myomotion/biomechanics/rep_segmenter.py`
- [Form rules](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/biomechanics/deadlift_rules.py): `src/myomotion/biomechanics/deadlift_rules.py`

### Coaching output

- [Visual feedback](https://github.com/ahmednawaz8813/myomotion/blob/main/src/myomotion/coaching/overlay.py): `src/myomotion/coaching/overlay.py`
- **Session files**

### sEMG acquisition

- [sEMG recorder](https://github.com/ahmednawaz8813/myomotion/blob/main/scripts/semg/record_session.py): `scripts/semg/record_session.py`
- [EMG logger](https://github.com/ahmednawaz8813/myomotion/blob/main/hardware/emg_logger/emg_logger.ino): `hardware/emg_logger/emg_logger.ino`

### Other components

- **User**

## Connections

- User → Deadlift demo: provides video (evidence: `README.md`)
- Deadlift demo → Pose tracking: requests landmarks (evidence: `scripts/demo_deadlift.py`)
- Deadlift demo → Synthetic frames: generates frames (evidence: `scripts/demo_deadlift.py`)
- Deadlift demo → Frame analyzer: analyzes frames (evidence: `README.md`)
- Deadlift demo → Visual feedback: renders feedback (evidence: `scripts/demo_deadlift.py`)
- Deadlift demo → Session files: writes summary/video (evidence: `README.md`)
- Legacy tracker → Geometry primitives: uses (evidence: `scripts/cv/deadlift/deadlift_tracker.py`)
- Legacy tracker → Landmark helpers: uses (evidence: `scripts/cv/deadlift/deadlift_tracker.py`)
- Legacy tracker → Rep phases: uses (evidence: `scripts/cv/deadlift/deadlift_tracker.py`)
- Legacy tracker → Signal filters: uses (evidence: `scripts/cv/deadlift/deadlift_tracker.py`)
- Frame analyzer → Signal filters: smooths signals (evidence: `src/myomotion/biomechanics/deadlift_pipeline.py`)
- Frame analyzer → Landmark helpers: selects side (evidence: `src/myomotion/biomechanics/deadlift_pipeline.py`)
- Frame analyzer → Kinematics: computes kinematics (evidence: `src/myomotion/biomechanics/deadlift_pipeline.py`)
- Frame analyzer → Spine proxy: uses proxy (evidence: `src/myomotion/biomechanics/deadlift_pipeline.py`)
- Frame analyzer → Rep phases: tracks phases (evidence: `src/myomotion/biomechanics/deadlift_pipeline.py`)
- Frame analyzer → Form rules: evaluates form (evidence: `src/myomotion/biomechanics/deadlift_pipeline.py`)
- Kinematics → Geometry primitives: uses primitives (evidence: `src/myomotion/biomechanics/deadlift_angles.py`)
- Kinematics → Landmark helpers: uses pose helpers (evidence: `src/myomotion/biomechanics/deadlift_angles.py`)
- Kinematics → Spine proxy: builds proxy (evidence: `src/myomotion/biomechanics/deadlift_angles.py`)
- Spine proxy → Geometry primitives: uses primitives (evidence: `src/myomotion/biomechanics/spine_proxy.py`)
- Spine proxy → Landmark helpers: uses pose helpers (evidence: `src/myomotion/biomechanics/spine_proxy.py`)
- Rep phases → Signal filters: uses filters (evidence: `src/myomotion/biomechanics/rep_segmenter.py`)
- Form rules → Kinematics: reads angles (evidence: `src/myomotion/biomechanics/deadlift_rules.py`)
- Form rules → Rep phases: reads phases (evidence: `src/myomotion/biomechanics/deadlift_rules.py`)
- Form rules → Spine proxy: reads proxy (evidence: `src/myomotion/biomechanics/deadlift_rules.py`)
- Visual feedback → Frame analyzer: reads results (evidence: `src/myomotion/coaching/overlay.py`)
- Visual feedback → Form rules: displays cues (evidence: `src/myomotion/coaching/overlay.py`)
- sEMG recorder → EMG logger: acquires serial data
