# dexxeth/mouse-control-with-hand-gestures architecture

> Architecture diagram of the GitHub repository dexxeth/mouse-control-with-hand-gestures, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dexxeth/mouse-control-with-hand-gestures
- Repository: https://github.com/dexxeth/mouse-control-with-hand-gestures

## Overview

##### Project type and purpose
- This is a single‐process Python application providing real‐time mouse control via hand gestures. It combines a video‐processing pipeline (OpenCV + MediaPipe), a gesture‐to‐action mapping layer (PyAutoGUI), and a lightweight UI built with Streamlit for live toggles and metrics.

##### File structure
- Top‐level files:
- gesture_mouse.py – core gesture detection & action logic
- main.py – application entry point (acts as the Streamlit UI runner)
- render.yml – (presumably CI/deployment config)
- requirements.txt – dependencies
- No separate “frontend” vs. “backend” dirs—this is a monolithic Python app.
- Presence of __pycache__ suggests it’s pure Python.
- No microservices or database; everything runs in a single runtime.

##### Extract insights from the README
- Key components described:
- Video capture & display (OpenCV)
- Hand landmark detection (MediaPipe)
- Gesture classification: pinch detection, movement tracking
- Smoothing & filtering (deadzone, stability, buffer)
- Action execution (mouse move, click via PyAutoGUI)
- Streamlit UI: start/stop toggle, FPS counter, parameter sliders

- Use clear labels for every component
- Related modules with a boundary or shaded region (e.g., “Gesture Processing Subsystem”)

##### Details
- Smoothing buffer, deadzone, and stability filter as distinct subcomponents

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Application"
        subgraph "Capture & Detection"
            VideoCaptureModule["Video Capture Module\n(OpenCV)"]:::blue
            HandLandmarkDetector["Hand Landmark Detector\n(MediaPipe)"]:::blue
        end
        subgraph "Gesture Processing Subsystem"
            GestureRecognitionFilters["Gesture Recognition & Filters\n(Buffer, Deadzone, Stability)"]:::green
        end
        subgraph "Action Mapping"
            ActionMappingEngine["Action Mapping Engine\n(PyAutoGUI)"]:::green
        end
        subgraph "UI Layer"
            StreamlitUI["Streamlit UI\n(Toggle, FPS, Sliders, Video Overlay)"]:::orange
            AppEntryPoint["Application Entry Point"]:::orange
        end
    end

    WebcamInput["Webcam Input"]:::external
    OS["Operating System\n(Desktop Env)"]:::red
    Docs1["Dependencies\n(requirements.txt)"]:::docs
    Docs2["CI/Deployment Config\n(render.yml)"]:::docs

    WebcamInput --> VideoCaptureModule
    VideoCaptureModule --> HandLandmarkDetector
    HandLandmarkDetector --> GestureRecognitionFilters
    GestureRecognitionFilters --> ActionMappingEngine
    ActionMappingEngine --> OS
    VideoCaptureModule --> StreamlitUI
    StreamlitUI -.-> GestureRecognitionFilters
    StreamlitUI -.-> ActionMappingEngine
    StreamlitUI --> AppEntryPoint

    click VideoCaptureModule "https://github.com/dexxeth/mouse-control-with-hand-gestures/blob/main/gesture_mouse.py"
    click HandLandmarkDetector "https://github.com/dexxeth/mouse-control-with-hand-gestures/blob/main/gesture_mouse.py"
    click GestureRecognitionFilters "https://github.com/dexxeth/mouse-control-with-hand-gestures/blob/main/gesture_mouse.py"
    click ActionMappingEngine "https://github.com/dexxeth/mouse-control-with-hand-gestures/blob/main/gesture_mouse.py"
    click StreamlitUI "https://github.com/dexxeth/mouse-control-with-hand-gestures/blob/main/main.py"
    click AppEntryPoint "https://github.com/dexxeth/mouse-control-with-hand-gestures/blob/main/main.py"
    click Docs1 "https://github.com/dexxeth/mouse-control-with-hand-gestures/blob/main/requirements.txt"
    click Docs2 "https://github.com/dexxeth/mouse-control-with-hand-gestures/blob/main/render.yml"

    classDef blue fill:#CCE5FF,stroke:#004085,color:#004085
    classDef green fill:#D4EDDA,stroke:#155724,color:#155724
    classDef orange fill:#FFF3CD,stroke:#856404,color:#856404
    classDef red fill:#F8D7DA,stroke:#721c24,color:#721c24
    classDef external fill:#E2E3E5,stroke:#6C757D,color:#6C757D
    classDef docs fill:#E2EDF7,stroke:#2F5597,color:#2F5597
```
