# syntaxaeror/ipd architecture

> Architecture diagram of the GitHub repository syntaxaeror/ipd, 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/syntaxaeror/ipd
- Repository: https://github.com/syntaxaeror/ipd

## Overview

EduAware is a classroom behavior and attention analytics application. Its main workflow reads video frames, detects and tracks people and nearby phone/notebook objects, derives pose metrics, scores behaviors, smooths per-student results, displays overlays, and exports a session CSV. The graph also shows shared data and configuration. The README is empty; training, face registration, and some visualization details are not described by the available source excerpts, so they are not expanded into speculative runtime branches.

Main entry points: [`main.py`](https://github.com/syntaxaeror/ipd/blob/main/main.py) (Session Loop), [`src/tracker.py`](https://github.com/syntaxaeror/ipd/blob/main/src/tracker.py) (Student Tracker), [`src/metrics.py`](https://github.com/syntaxaeror/ipd/blob/main/src/metrics.py) (Pose Metrics), [`config.py`](https://github.com/syntaxaeror/ipd/blob/main/config.py) (Runtime Config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Video Inference"]
  node_video["Video Input<br/>[talking2.mp4]"]
  node_app["Session Loop<br/>[main.py]"]
  node_detector["Pose Detector<br/>[ai_engine.py]"]
end

subgraph group_analysis["Behavior Analysis"]
  node_tracker["Student Tracker<br/>[tracker.py]"]
  node_metrics["Pose Metrics<br/>[metrics.py]"]
  node_scoring["Behavior Scoring<br/>[scoring.py]"]
end

subgraph group_outputs["Session Outputs"]
  node_visualizer["Frame Visualization<br/>[visualization.py]"]
  node_report["CSV Reporting<br/>[report.py]"]
end

subgraph group_shared["Shared Runtime"]
  node_types["Result Types<br/>[datatypes.py]"]
  node_config["Runtime Config<br/>[config.py]"]
end

node_operator(("Operator"))
node_webcam(("Webcam"))

node_operator -->|"starts"| node_app
node_app -->|"opens"| node_video
node_app -->|"falls back"| node_webcam
node_app -->|"tracks frames"| node_detector
node_detector -->|"reads settings"| node_config
node_app -->|"processes detections"| node_tracker
node_tracker -->|"extracts metrics"| node_metrics
node_tracker -->|"assesses behavior"| node_scoring
node_tracker -->|"returns results"| node_types
node_metrics -->|"creates metrics"| node_types
node_metrics -->|"reads thresholds"| node_config
node_tracker -->|"reads window"| node_config
node_app -->|"draws results"| node_visualizer
node_app -->|"exports session"| node_report
node_report -->|"reads track state"| node_tracker

click node_video "https://github.com/syntaxaeror/ipd/blob/main/data/talking2.mp4"
click node_app "https://github.com/syntaxaeror/ipd/blob/main/main.py"
click node_detector "https://github.com/syntaxaeror/ipd/blob/main/src/ai_engine.py"
click node_tracker "https://github.com/syntaxaeror/ipd/blob/main/src/tracker.py"
click node_metrics "https://github.com/syntaxaeror/ipd/blob/main/src/metrics.py"
click node_scoring "https://github.com/syntaxaeror/ipd/blob/main/src/scoring.py"
click node_types "https://github.com/syntaxaeror/ipd/blob/main/src/datatypes.py"
click node_config "https://github.com/syntaxaeror/ipd/blob/main/config.py"
click node_visualizer "https://github.com/syntaxaeror/ipd/blob/main/src/visualization.py"
click node_report "https://github.com/syntaxaeror/ipd/blob/main/src/report.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_video,node_app,node_detector toneBlue
class node_tracker,node_metrics,node_scoring toneAmber
class node_visualizer,node_report toneMint
class node_types,node_config toneRose
class node_operator,node_webcam toneIndigo
```

## Components

### Video Inference

- [Video Input](https://github.com/syntaxaeror/ipd/blob/main/data/talking2.mp4): `data/talking2.mp4`
- [Session Loop](https://github.com/syntaxaeror/ipd/blob/main/main.py): `main.py`
- [Pose Detector](https://github.com/syntaxaeror/ipd/blob/main/src/ai_engine.py): `src/ai_engine.py`

### Behavior Analysis

- [Student Tracker](https://github.com/syntaxaeror/ipd/blob/main/src/tracker.py): `src/tracker.py`
- [Pose Metrics](https://github.com/syntaxaeror/ipd/blob/main/src/metrics.py): `src/metrics.py`
- [Behavior Scoring](https://github.com/syntaxaeror/ipd/blob/main/src/scoring.py): `src/scoring.py`

### Session Outputs

- [Frame Visualization](https://github.com/syntaxaeror/ipd/blob/main/src/visualization.py): `src/visualization.py`
- [CSV Reporting](https://github.com/syntaxaeror/ipd/blob/main/src/report.py): `src/report.py`

### Shared Runtime

- [Result Types](https://github.com/syntaxaeror/ipd/blob/main/src/datatypes.py): `src/datatypes.py`
- [Runtime Config](https://github.com/syntaxaeror/ipd/blob/main/config.py): `config.py`

### Other components

- **Operator**
- **Webcam**

## Connections

- Operator → Session Loop: starts (evidence: `main.py`)
- Session Loop → Video Input: opens (evidence: `main.py`)
- Session Loop → Webcam: falls back (evidence: `main.py`)
- Session Loop → Pose Detector: tracks frames (evidence: `main.py`)
- Pose Detector → Runtime Config: reads settings (evidence: `src/ai_engine.py`)
- Session Loop → Student Tracker: processes detections (evidence: `main.py`)
- Student Tracker → Pose Metrics: extracts metrics (evidence: `src/tracker.py`)
- Student Tracker → Behavior Scoring: assesses behavior (evidence: `src/tracker.py`)
- Student Tracker → Result Types: returns results (evidence: `src/tracker.py`)
- Pose Metrics → Result Types: creates metrics (evidence: `src/metrics.py`)
- Pose Metrics → Runtime Config: reads thresholds (evidence: `src/metrics.py`)
- Student Tracker → Runtime Config: reads window (evidence: `src/tracker.py`)
- Session Loop → Frame Visualization: draws results (evidence: `main.py`)
- Session Loop → CSV Reporting: exports session (evidence: `main.py`)
- CSV Reporting → Student Tracker: reads track state (evidence: `src/report.py`)
