# ysaicharanreddy1/volume-control-hand-gesture architecture

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

- Interactive diagram: https://gitdiagram.com/ysaicharanreddy1/volume-control-hand-gesture
- Repository: https://github.com/ysaicharanreddy1/volume-control-hand-gesture

## Overview

This project maps webcam hand gestures to Windows master volume in real time. The volume-control script captures and displays video, asks the hand-tracking module for landmarks, maps the distance between thumb and index-finger landmarks to the system volume range, and sends that value to the Windows audio endpoint. The README documents this capability and its libraries; the graph reflects the two supplied source files. The camera and display are represented as external endpoints.

Main entry points: [`HGVC_Project/Volume_Control_Project.py`](https://github.com/ysaicharanreddy1/volume-control-hand-gesture/blob/main/HGVC_Project/Volume_Control_Project.py) (Volume app loop), [`HGVC_Project/HandTrackingModule.py`](https://github.com/ysaicharanreddy1/volume-control-hand-gesture/blob/main/HGVC_Project/HandTrackingModule.py) (Hand detector)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Video input"]
  node_camera(("Webcam"))
  node_display["Video display"]
end

subgraph group_vision["Hand tracking"]
  node_hand_detector["Hand detector"]
  node_mediapipe["MediaPipe Hands"]
  node_landmarks["Hand landmarks"]
end

subgraph group_control["Volume control"]
  node_volume_app["Volume app loop"]
  node_gesture_mapping["Distance mapping"]
  node_audio_endpoint["Windows audio endpoint"]
end

node_user(("User"))

node_user -->|"gestures"| node_camera
node_camera -->|"frames"| node_volume_app
node_volume_app -->|"requests landmarks"| node_hand_detector
node_hand_detector -->|"processes frames"| node_mediapipe
node_hand_detector -->|"extracts coordinates"| node_landmarks
node_landmarks -->|"returns positions"| node_volume_app
node_volume_app -->|"measures fingertips"| node_gesture_mapping
node_gesture_mapping -->|"sets master volume"| node_audio_endpoint
node_volume_app -->|"shows annotated frames"| node_display

click node_volume_app "https://github.com/ysaicharanreddy1/volume-control-hand-gesture/blob/main/HGVC_Project/Volume_Control_Project.py"
click node_hand_detector "https://github.com/ysaicharanreddy1/volume-control-hand-gesture/blob/main/HGVC_Project/HandTrackingModule.py"
click node_landmarks "https://github.com/ysaicharanreddy1/volume-control-hand-gesture/blob/main/HGVC_Project/HandTrackingModule.py"
click node_gesture_mapping "https://github.com/ysaicharanreddy1/volume-control-hand-gesture/blob/main/HGVC_Project/Volume_Control_Project.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_camera,node_display,node_user toneBlue
class node_hand_detector,node_mediapipe,node_landmarks toneAmber
class node_volume_app,node_gesture_mapping,node_audio_endpoint toneMint
```

## Components

### Video input

- **Webcam**
- **Video display**

### Hand tracking

- [Hand detector](https://github.com/ysaicharanreddy1/volume-control-hand-gesture/blob/main/HGVC_Project/HandTrackingModule.py): `HGVC_Project/HandTrackingModule.py`
- **MediaPipe Hands**
- [Hand landmarks](https://github.com/ysaicharanreddy1/volume-control-hand-gesture/blob/main/HGVC_Project/HandTrackingModule.py): `HGVC_Project/HandTrackingModule.py`

### Volume control

- [Volume app loop](https://github.com/ysaicharanreddy1/volume-control-hand-gesture/blob/main/HGVC_Project/Volume_Control_Project.py): `HGVC_Project/Volume_Control_Project.py`
- [Distance mapping](https://github.com/ysaicharanreddy1/volume-control-hand-gesture/blob/main/HGVC_Project/Volume_Control_Project.py): `HGVC_Project/Volume_Control_Project.py`
- **Windows audio endpoint**

### Other components

- **User**

## Connections

- User → Webcam: gestures
- Webcam → Volume app loop: frames
- Volume app loop → Hand detector: requests landmarks
- Hand detector → MediaPipe Hands: processes frames
- Hand detector → Hand landmarks: extracts coordinates
- Hand landmarks → Volume app loop: returns positions
- Volume app loop → Distance mapping: measures fingertips
- Distance mapping → Windows audio endpoint: sets master volume
- Volume app loop → Video display: shows annotated frames
