# shivam-kotwalia/gesture-control architecture

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

- Interactive diagram: https://gitdiagram.com/shivam-kotwalia/gesture-control
- Repository: https://github.com/shivam-kotwalia/gesture-control

## Overview

Gesture Control Presenter is a webcam-based Google Slides controller. Its main workflow captures camera frames, detects hand landmarks, classifies finger positions, maps gestures to keyboard actions, and displays a live preview. A separate setup script downloads the hand-landmarker model required by the runtime. The graph reflects the README and sampled source; the model file is described by the code but is not present in the supplied file tree.

Main entry points: [`main.py`](https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py) (Frame Capture), [`setup_models.py`](https://github.com/shivam-kotwalia/gesture-control/blob/main/setup_models.py) (Model Download)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Camera Input"]
  node_webcam["Laptop Webcam"]
  node_capture["Frame Capture<br/>[main.py]"]
  node_preview["Live Preview<br/>[main.py]"]
end

subgraph group_gesture["Gesture Processing"]
  node_detector["Hand Detection<br/>[main.py]"]
  node_finger_count["Finger Counting<br/>[main.py]"]
  node_gesture_map["Gesture Mapping<br/>[main.py]"]
  node_model["Hand Model"]
  node_model_setup["Model Download<br/>[setup_models.py]"]
end

subgraph group_control["Presentation Control"]
  node_keyboard["Keyboard Automation<br/>[main.py]"]
  node_slides["Google Slides"]
end

node_user(("Presenter"))

node_webcam -->|"provides frames"| node_capture
node_capture -->|"sends frames"| node_detector
node_detector -->|"loads model"| node_model
node_detector -->|"provides landmarks"| node_finger_count
node_finger_count -->|"counts fingers"| node_gesture_map
node_gesture_map -->|"triggers shortcuts"| node_keyboard
node_keyboard -->|"controls slides"| node_slides
node_capture -->|"displays frames"| node_preview
node_gesture_map -->|"shows gesture"| node_preview
node_user -->|"shows gestures"| node_webcam
node_user -->|"stops app"| node_preview
node_model_setup -->|"downloads model"| node_model

click node_capture "https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py"
click node_preview "https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py"
click node_detector "https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py"
click node_finger_count "https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py"
click node_gesture_map "https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py"
click node_model_setup "https://github.com/shivam-kotwalia/gesture-control/blob/main/setup_models.py"
click node_keyboard "https://github.com/shivam-kotwalia/gesture-control/blob/main/main.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_webcam,node_capture,node_preview toneBlue
class node_detector,node_finger_count,node_gesture_map,node_model,node_model_setup toneAmber
class node_keyboard,node_slides toneMint
class node_user toneIndigo
```

## Components

### Camera Input

- **Laptop Webcam**
- [Frame Capture](https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py): `main.py`
- [Live Preview](https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py): `main.py`

### Gesture Processing

- [Hand Detection](https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py): `main.py`
- [Finger Counting](https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py): `main.py`
- [Gesture Mapping](https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py): `main.py`
- **Hand Model**
- [Model Download](https://github.com/shivam-kotwalia/gesture-control/blob/main/setup_models.py): `setup_models.py`

### Presentation Control

- [Keyboard Automation](https://github.com/shivam-kotwalia/gesture-control/blob/main/main.py): `main.py`
- **Google Slides**

### Other components

- **Presenter**

## Connections

- Laptop Webcam → Frame Capture: provides frames (evidence: `main.py`)
- Frame Capture → Hand Detection: sends frames (evidence: `main.py`)
- Hand Detection → Hand Model: loads model (evidence: `main.py`)
- Hand Detection → Finger Counting: provides landmarks (evidence: `main.py`)
- Finger Counting → Gesture Mapping: counts fingers (evidence: `main.py`)
- Gesture Mapping → Keyboard Automation: triggers shortcuts (evidence: `main.py`)
- Keyboard Automation → Google Slides: controls slides (evidence: `README.md`)
- Frame Capture → Live Preview: displays frames (evidence: `main.py`)
- Gesture Mapping → Live Preview: shows gesture (evidence: `main.py`)
- Presenter → Laptop Webcam: shows gestures (evidence: `README.md`)
- Presenter → Live Preview: stops app (evidence: `main.py`)
- Model Download → Hand Model: downloads model (evidence: `setup_models.py`)
