# chandu991/gesture-control-media-player architecture

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

- Interactive diagram: https://gitdiagram.com/chandu991/gesture-control-media-player
- Repository: https://github.com/chandu991/gesture-control-media-player

## Overview

This is a webcam-based gesture media controller. The principal workflow is camera capture in the main loop, hand landmark detection and gesture recognition, frame display, then stable-gesture dispatch to media-key commands. Detection, finger counting, and recognition are implemented in one module, with finger counting shown separately to clarify that internal layer. The README documents the control mapping and real-time capabilities; the sampled source supports the runtime edges shown here.

Main entry points: [`main.py`](https://github.com/chandu991/gesture-control-media-player/blob/main/main.py) (Capture and Dispatch), [`gesture_detector.py`](https://github.com/chandu991/gesture-control-media-player/blob/main/gesture_detector.py) (Hand Detection), [`media_controller.py`](https://github.com/chandu991/gesture-control-media-player/blob/main/media_controller.py) (Media Commands), [`config.py`](https://github.com/chandu991/gesture-control-media-player/blob/main/config.py) (Runtime Settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_main["Capture and Dispatch<br/>[main.py]"]
  node_config["Runtime Settings<br/>[config.py]"]
end

subgraph group_vision["Gesture Vision"]
  node_hand_detection["Hand Detection"]
  node_landmark_overlay["Landmark Overlay"]
  node_gesture_recognition["Gesture Recognition"]
  node_finger_count["Finger Counting"]
end

subgraph group_control["Media Control"]
  node_media_controller["Media Commands"]
end

node_webcam(("Webcam"))
node_preview(("Camera Preview"))
node_mediapipe["MediaPipe"]
node_media_player(("Media Player"))

node_main -->|"captures frames"| node_webcam
node_main -->|"loads settings"| node_config
node_hand_detection -->|"loads thresholds"| node_config
node_main -->|"detects hands"| node_hand_detection
node_hand_detection -->|"runs landmark model"| node_mediapipe
node_main -->|"draws landmarks"| node_landmark_overlay
node_main -->|"recognizes gesture"| node_gesture_recognition
node_gesture_recognition -->|"counts fingers"| node_finger_count
node_main -->|"dispatches commands"| node_media_controller
node_media_controller -->|"sends media keys"| node_media_player
node_main -->|"shows camera view"| node_preview

click node_main "https://github.com/chandu991/gesture-control-media-player/blob/main/main.py"
click node_config "https://github.com/chandu991/gesture-control-media-player/blob/main/config.py"
click node_hand_detection "https://github.com/chandu991/gesture-control-media-player/blob/main/gesture_detector.py"
click node_landmark_overlay "https://github.com/chandu991/gesture-control-media-player/blob/main/gesture_detector.py"
click node_gesture_recognition "https://github.com/chandu991/gesture-control-media-player/blob/main/gesture_detector.py"
click node_finger_count "https://github.com/chandu991/gesture-control-media-player/blob/main/gesture_detector.py"
click node_media_controller "https://github.com/chandu991/gesture-control-media-player/blob/main/media_controller.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_main,node_config,node_preview toneBlue
class node_hand_detection,node_landmark_overlay,node_gesture_recognition,node_finger_count toneAmber
class node_media_controller,node_mediapipe toneMint
class node_webcam,node_media_player toneIndigo
```

## Components

### Runtime

- [Capture and Dispatch](https://github.com/chandu991/gesture-control-media-player/blob/main/main.py): `main.py`
- [Runtime Settings](https://github.com/chandu991/gesture-control-media-player/blob/main/config.py): `config.py`

### Gesture Vision

- [Hand Detection](https://github.com/chandu991/gesture-control-media-player/blob/main/gesture_detector.py): `gesture_detector.py`
- [Landmark Overlay](https://github.com/chandu991/gesture-control-media-player/blob/main/gesture_detector.py): `gesture_detector.py`
- [Gesture Recognition](https://github.com/chandu991/gesture-control-media-player/blob/main/gesture_detector.py): `gesture_detector.py`
- [Finger Counting](https://github.com/chandu991/gesture-control-media-player/blob/main/gesture_detector.py): `gesture_detector.py`

### Media Control

- [Media Commands](https://github.com/chandu991/gesture-control-media-player/blob/main/media_controller.py): `media_controller.py`

### Other components

- **Webcam**
- **Camera Preview**
- **MediaPipe**
- **Media Player**

## Connections

- Capture and Dispatch → Webcam: captures frames (evidence: `main.py`)
- Capture and Dispatch → Runtime Settings: loads settings (evidence: `main.py`)
- Hand Detection → Runtime Settings: loads thresholds (evidence: `gesture_detector.py`)
- Capture and Dispatch → Hand Detection: detects hands (evidence: `main.py`)
- Hand Detection → MediaPipe: runs landmark model (evidence: `gesture_detector.py`)
- Capture and Dispatch → Landmark Overlay: draws landmarks (evidence: `main.py`)
- Capture and Dispatch → Gesture Recognition: recognizes gesture (evidence: `main.py`)
- Gesture Recognition → Finger Counting: counts fingers (evidence: `gesture_detector.py`)
- Capture and Dispatch → Media Commands: dispatches commands (evidence: `main.py`)
- Media Commands → Media Player: sends media keys (evidence: `media_controller.py`)
- Capture and Dispatch → Camera Preview: shows camera view (evidence: `main.py`)
