# yashhhh-5/hand-filter architecture

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

- Interactive diagram: https://gitdiagram.com/yashhhh-5/hand-filter
- Repository: https://github.com/yashhhh-5/hand-filter

## Overview

Hand Portal Filters is a webcam-based visual-effects app: the user presents both hands to form a portal, then cycles image filters with pinches or keyboard controls. The single Python module contains model setup, hand/gesture handling, filter effects, and frame compositing. The excerpt confirms filter application and pinch-distance use; omitted code limits certainty about some internal calls and camera-frame processing.

Main entry points: [`hand_portal_filters.py`](https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.py) (App loop), [`hand_landmarker.task`](https://github.com/yashhhh-5/hand-filter/blob/main/hand_landmarker.task) (Landmarker model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and input"]
  node_app["App loop"]
  node_camera["Webcam"]
end

subgraph group_vision["Hand interaction"]
  node_model["Landmarker model"]
  node_hand_detection["Hand detection"]
  node_pinch["Pinch detection"]
end

subgraph group_effects["Portal effects"]
  node_filter_bank["Filter effects"]
  node_compositor["Portal compositor"]
end

node_user(("User"))

node_user -->|"controls"| node_app
node_app -->|"captures frames"| node_camera
node_app -->|"loads model"| node_model
node_app -.->|"processes hands"| node_hand_detection
node_app -->|"checks distance"| node_pinch
node_app -.->|"selects filter"| node_filter_bank
node_app -->|"applies filter"| node_compositor

click node_app "https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.py"
click node_model "https://github.com/yashhhh-5/hand-filter/blob/main/hand_landmarker.task"
click node_hand_detection "https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.py"
click node_pinch "https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.py"
click node_filter_bank "https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.py"
click node_compositor "https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.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_camera,node_user toneBlue
class node_model,node_hand_detection,node_pinch toneAmber
class node_filter_bank,node_compositor toneMint
```

## Components

### Runtime and input

- [App loop](https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.py): `hand_portal_filters.py`
- **Webcam**

### Hand interaction

- [Landmarker model](https://github.com/yashhhh-5/hand-filter/blob/main/hand_landmarker.task): `hand_landmarker.task`
- [Hand detection](https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.py): `hand_portal_filters.py`
- [Pinch detection](https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.py): `hand_portal_filters.py`

### Portal effects

- [Filter effects](https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.py): `hand_portal_filters.py`
- [Portal compositor](https://github.com/yashhhh-5/hand-filter/blob/main/hand_portal_filters.py): `hand_portal_filters.py`

### Other components

- **User**

## Connections

- User → App loop: controls (evidence: `hand_portal_filters.py`)
- App loop → Webcam: captures frames (evidence: `hand_portal_filters.py`)
- App loop → Landmarker model: loads model (evidence: `hand_portal_filters.py`)
- App loop → Hand detection: processes hands (evidence: `hand_portal_filters.py`)
- App loop → Pinch detection: checks distance (evidence: `hand_portal_filters.py`)
- App loop → Filter effects: selects filter (evidence: `hand_portal_filters.py`)
- App loop → Portal compositor: applies filter (evidence: `hand_portal_filters.py`)
