# leo4bits/poserecognition architecture

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

- Interactive diagram: https://gitdiagram.com/leo4bits/poserecognition
- Repository: https://github.com/leo4bits/poserecognition

## Overview

This is a small video action-recognition script: it reads video frames, tracks people with YOLO pose, classifies actions from keypoints and per-person history, annotates frames, and writes a video. The graph reflects the single sampled implementation; there is no README describing additional capabilities.

Main entry points: [`model_OOP.py`](https://github.com/leo4bits/poserecognition/blob/main/model_OOP.py) (Action Recognizer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_entry["Script Entry<br/>[model_OOP.py]"]
  node_recognizer["Action Recognizer<br/>[model_OOP.py]"]
  node_video_input["Input Video"]
  node_track_history["Track History<br/>[model_OOP.py]"]
end

subgraph group_vision["Pose And Actions"]
  node_pose_tracker["YOLO Pose Tracker"]
  node_classifier["Action Classifier<br/>[model_OOP.py]"]
  node_geometry["Keypoint Geometry<br/>[model_OOP.py]"]
end

subgraph group_output["Video Output"]
  node_opencv["OpenCV"]
  node_video_output["Annotated Video"]
end

node_operator(("Operator"))

node_operator -->|"starts"| node_entry
node_entry -->|"creates and runs"| node_recognizer
node_recognizer -->|"opens video"| node_opencv
node_video_input -->|"read by"| node_opencv
node_recognizer -->|"tracks frames"| node_pose_tracker
node_pose_tracker -->|"returns detections"| node_recognizer
node_recognizer -->|"classifies keypoints"| node_classifier
node_classifier -->|"calculates distances and angles"| node_geometry
node_classifier -->|"reads and updates"| node_track_history
node_classifier -->|"draws keypoint lines"| node_opencv
node_recognizer -->|"annotates and writes frames"| node_opencv
node_opencv -->|"encodes frames"| node_video_output

click node_entry "https://github.com/leo4bits/poserecognition/blob/main/model_OOP.py"
click node_recognizer "https://github.com/leo4bits/poserecognition/blob/main/model_OOP.py"
click node_classifier "https://github.com/leo4bits/poserecognition/blob/main/model_OOP.py"
click node_geometry "https://github.com/leo4bits/poserecognition/blob/main/model_OOP.py"
click node_track_history "https://github.com/leo4bits/poserecognition/blob/main/model_OOP.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_entry,node_recognizer,node_video_input,node_track_history toneBlue
class node_pose_tracker,node_classifier,node_geometry toneAmber
class node_opencv,node_video_output toneMint
class node_operator toneIndigo
```

## Components

### Runtime

- [Script Entry](https://github.com/leo4bits/poserecognition/blob/main/model_OOP.py): `model_OOP.py`
- [Action Recognizer](https://github.com/leo4bits/poserecognition/blob/main/model_OOP.py): `model_OOP.py`
- **Input Video**
- [Track History](https://github.com/leo4bits/poserecognition/blob/main/model_OOP.py): `model_OOP.py`

### Pose And Actions

- **YOLO Pose Tracker**
- [Action Classifier](https://github.com/leo4bits/poserecognition/blob/main/model_OOP.py): `model_OOP.py`
- [Keypoint Geometry](https://github.com/leo4bits/poserecognition/blob/main/model_OOP.py): `model_OOP.py`

### Video Output

- **OpenCV**
- **Annotated Video**

### Other components

- **Operator**

## Connections

- Operator → Script Entry: starts
- Script Entry → Action Recognizer: creates and runs
- Action Recognizer → OpenCV: opens video
- Input Video → OpenCV: read by
- Action Recognizer → YOLO Pose Tracker: tracks frames
- YOLO Pose Tracker → Action Recognizer: returns detections
- Action Recognizer → Action Classifier: classifies keypoints
- Action Classifier → Keypoint Geometry: calculates distances and angles
- Action Classifier → Track History: reads and updates
- Action Classifier → OpenCV: draws keypoint lines
- Action Recognizer → OpenCV: annotates and writes frames
- OpenCV → Annotated Video: encodes frames
