# summaira-muzaffar/airframe-studio architecture

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

- Interactive diagram: https://gitdiagram.com/summaira-muzaffar/airframe-studio
- Repository: https://github.com/summaira-muzaffar/airframe-studio

## Overview

AirFrame Studio is a camera-based gesture art application. The main workflow is hand tracking → frame or face capture → perspective correction → image styling → floating-panel review and air-drawing → gallery save. The graph also includes the optional pinch/face mode and optional diffusion styling. The app excerpt is partial, so some orchestration links rely on README statements and the SOURCE INDEX; unsampled internals are not treated as inspected.

Main entry points: [`app.py`](https://github.com/summaira-muzaffar/airframe-studio/blob/master/app.py) (App and modes), [`hand_tracker.py`](https://github.com/summaira-muzaffar/airframe-studio/blob/master/hand_tracker.py) (Hand tracking), [`inference.py`](https://github.com/summaira-muzaffar/airframe-studio/blob/master/inference.py) (Async styling), [`face_crop.py`](https://github.com/summaira-muzaffar/airframe-studio/blob/master/face_crop.py) (Face detection and crop)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Live interaction"]
  node_app["App and modes<br/>[app.py]"]
  node_tracker["Hand tracking<br/>[hand_tracker.py]"]
  node_smoothing["Adaptive smoothing<br/>[smoothing.py]"]
end

subgraph group_capture["Capture and geometry"]
  node_face["Face detection and crop<br/>[face_crop.py]"]
  node_geometry["Perspective transforms<br/>[perspective.py]"]
end

subgraph group_artwork["Artwork and styling"]
  node_styler["Async styling<br/>[inference.py]"]
  node_styles["OpenCV art styles<br/>[styles.py]"]
  node_diffusion["Diffusion backend<br/>[inference.py]"]
  node_canvas["Air-drawing canvas<br/>[canvas.py]"]
end

subgraph group_persistence["Gallery and assets"]
  node_models["Model downloads<br/>[model_files.py]"]
  node_gallery["Gallery saving<br/>[gallery.py]"]
  node_gallery_files[("Gallery files")]
end

subgraph group_presentation["Interface"]
  node_overlay["HUD and guides<br/>[ui_overlay.py]"]
end

node_user(("User"))
node_camera["Camera"]

node_user -->|"gestures and keys"| node_app
node_camera -->|"video frames"| node_app
node_app -->|"submits frames"| node_tracker
node_app -->|"smooths motion"| node_smoothing
node_tracker -->|"smooths landmarks"| node_smoothing
node_app -->|"rectifies captures"| node_geometry
node_app -->|"requests face crop"| node_face
node_tracker -->|"loads hand model"| node_models
node_face -->|"loads face model"| node_models
node_app -->|"submits artwork"| node_styler
node_styler -->|"applies style"| node_styles
node_styler -.->|"optionally transforms"| node_diffusion
node_app -->|"maps drawing coordinates"| node_geometry
node_app -->|"records and renders strokes"| node_canvas
node_app -->|"saves artwork"| node_gallery
node_gallery -->|"writes gallery"| node_gallery_files
node_app -->|"draws interface"| node_overlay

click node_app "https://github.com/summaira-muzaffar/airframe-studio/blob/master/app.py"
click node_tracker "https://github.com/summaira-muzaffar/airframe-studio/blob/master/hand_tracker.py"
click node_smoothing "https://github.com/summaira-muzaffar/airframe-studio/blob/master/smoothing.py"
click node_face "https://github.com/summaira-muzaffar/airframe-studio/blob/master/face_crop.py"
click node_geometry "https://github.com/summaira-muzaffar/airframe-studio/blob/master/perspective.py"
click node_models "https://github.com/summaira-muzaffar/airframe-studio/blob/master/model_files.py"
click node_styler "https://github.com/summaira-muzaffar/airframe-studio/blob/master/inference.py"
click node_styles "https://github.com/summaira-muzaffar/airframe-studio/blob/master/styles.py"
click node_diffusion "https://github.com/summaira-muzaffar/airframe-studio/blob/master/inference.py"
click node_canvas "https://github.com/summaira-muzaffar/airframe-studio/blob/master/canvas.py"
click node_gallery "https://github.com/summaira-muzaffar/airframe-studio/blob/master/gallery.py"
click node_overlay "https://github.com/summaira-muzaffar/airframe-studio/blob/master/ui_overlay.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_tracker,node_smoothing,node_user toneBlue
class node_face,node_geometry toneAmber
class node_styler,node_styles,node_diffusion,node_canvas toneMint
class node_models,node_gallery,node_gallery_files toneRose
class node_overlay,node_camera toneIndigo
```

## Components

### Live interaction

- [App and modes](https://github.com/summaira-muzaffar/airframe-studio/blob/master/app.py): `app.py`
- [Hand tracking](https://github.com/summaira-muzaffar/airframe-studio/blob/master/hand_tracker.py): `hand_tracker.py`
- [Adaptive smoothing](https://github.com/summaira-muzaffar/airframe-studio/blob/master/smoothing.py): `smoothing.py`

### Capture and geometry

- [Face detection and crop](https://github.com/summaira-muzaffar/airframe-studio/blob/master/face_crop.py): `face_crop.py`
- [Perspective transforms](https://github.com/summaira-muzaffar/airframe-studio/blob/master/perspective.py): `perspective.py`

### Artwork and styling

- [Async styling](https://github.com/summaira-muzaffar/airframe-studio/blob/master/inference.py): `inference.py`
- [OpenCV art styles](https://github.com/summaira-muzaffar/airframe-studio/blob/master/styles.py): `styles.py`
- [Diffusion backend](https://github.com/summaira-muzaffar/airframe-studio/blob/master/inference.py): `inference.py`
- [Air-drawing canvas](https://github.com/summaira-muzaffar/airframe-studio/blob/master/canvas.py): `canvas.py`

### Gallery and assets

- [Model downloads](https://github.com/summaira-muzaffar/airframe-studio/blob/master/model_files.py): `model_files.py`
- [Gallery saving](https://github.com/summaira-muzaffar/airframe-studio/blob/master/gallery.py): `gallery.py`
- **Gallery files**

### Interface

- [HUD and guides](https://github.com/summaira-muzaffar/airframe-studio/blob/master/ui_overlay.py): `ui_overlay.py`

### Other components

- **User**
- **Camera**

## Connections

- User → App and modes: gestures and keys (evidence: `README.md`)
- Camera → App and modes: video frames (evidence: `app.py`)
- App and modes → Hand tracking: submits frames (evidence: `README.md`)
- App and modes → Adaptive smoothing: smooths motion (evidence: `app.py`)
- Hand tracking → Adaptive smoothing: smooths landmarks (evidence: `hand_tracker.py`)
- App and modes → Perspective transforms: rectifies captures (evidence: `app.py`)
- App and modes → Face detection and crop: requests face crop (evidence: `app.py`)
- Hand tracking → Model downloads: loads hand model (evidence: `hand_tracker.py`)
- Face detection and crop → Model downloads: loads face model (evidence: `face_crop.py`)
- App and modes → Async styling: submits artwork (evidence: `README.md`)
- Async styling → OpenCV art styles: applies style (evidence: `inference.py`)
- Async styling → Diffusion backend: optionally transforms (evidence: `inference.py`)
- App and modes → Perspective transforms: maps drawing coordinates (evidence: `README.md`)
- App and modes → Air-drawing canvas: records and renders strokes (evidence: `README.md`)
- App and modes → Gallery saving: saves artwork (evidence: `README.md`)
- Gallery saving → Gallery files: writes gallery (evidence: `README.md`)
- App and modes → HUD and guides: draws interface (evidence: `app.py`)
