Chiravox

Chiravox

CHIRAVOX - Control Without Contact

 ██████╗██╗  ██╗██╗██████╗  █████╗ ██╗   ██╗ ██████╗ ██╗  ██╗
██╔════╝██║  ██║██║██╔══██╗██╔══██╗██║   ██║██╔═══██╗╚██╗██╔╝
██║     ███████║██║██████╔╝███████║██║   ██║██║   ██║ ╚███╔╝ 
██║     ██╔══██║██║██╔══██╗██╔══██║╚██╗ ██╔╝██║   ██║ ██╔██╗ 
╚██████╗██║  ██║██║██║  ██║██║  ██║ ╚████╔╝ ╚██████╔╝██╔╝ ██╗
 ╚═════╝╚═╝  ╚═╝╚═╝╚═╝  ╚═╝╚═╝  ╚═╝  ╚═══╝   ╚═════╝ ╚═╝  ╚═╝

Control Without Contact · Gesture-Driven Computing, Reimagined

Powered by MediaPipe · OpenCV · PyAutoGUI · Python · React · Hugging Face


License: MIT Python Version React Version FastAPI Version MediaPipe Hugging Face OpenCV PyAutoGUI PRs Welcome Build Status

Contributors Ideator - Harihar R Core Lead - Mohamed Salman P Voice Lead - Logesh M Backend Lead - Muthamil V Frontend Lead - Godfrey T R


Table of Contents

  1. Executive Summary & Concept
  2. Problem Statement
  3. Developer Story & Team Assignments
  4. System Architecture & Data Flow
  5. Folder & Component Structure
  6. Core Gesture Engine & Gesture Catalog
  7. Voice Command Engine & Command Catalog
  8. Settings GUI & Gesture Trainer
  9. API & WebSocket Specifications
  10. Configuration Schema
  11. System Requirements
  12. Installation & Deployment
  13. Verification & Testing
  14. Challenges, Mitigations & Future Roadmap
  15. Development Roadmap (14-Day Timeline)
  16. Contributors & Licensing

Executive Summary & Concept

CHIRAVOX is a software solution that replaces the conventional computer mouse with real-time hand gesture recognition via a standard webcam. Using Google’s MediaPipe framework for hand landmark detection, CHIRAVOX maps natural hand gestures to every standard mouse operation — including cursor movement, left and right clicking, double-clicking, drag-and-drop, and scrolling — without requiring specialized hardware depth cameras.

CHIRAVOX is further enhanced by:

Key Value: CHIRAVOX delivers a fully mouse-free computing experience using 22 hand gestures, 40+ voice commands, and a standard laptop webcam — no specialized hardware required.


Problem Statement

The physical mouse has remained the dominant pointing device for over four decades. While reliable, it presents barriers in several real-world scenarios:

  1. Accessibility: Users with limited hand mobility or physical disabilities struggle with precise physical mouse control.
  2. Hygiene-Sensitive Environments: Medical, cleanroom, and laboratory settings require touchless interaction with computer systems.
  3. Space Constraints: Mobile workers and students in crowded environments often lack a flat physical surface for mouse operation.
  4. AR/VR & Kiosk Environments: Emerging interfaces have no surface on which a physical mouse can operate.
  5. Fatigue & RSI: Prolonged mouse use contributes to Repetitive Strain Injury.

CHIRAVOX addresses all five scenarios simultaneously by providing a hygienic, natural, and hardware-free input alternative.


Developer Story & Team Assignments

Team Member Assignments & Responsibilities

Team Member Role / Focus Area Assigned Modules Key Responsibilities
Harihar R (@HARIHAR1406) System Ideator System Concept & Architecture Conceived initial vision and conceptual design for gesture-driven touchless computing.
Mohamed Salman P (@Salman4256) Core Gesture & Tracking Engine Lead python/camera.py
python/gesture_engine.py
python/gesture_mapping.py
Video capture, MediaPipe 21 landmark detection, smoothing filter, PyAutoGUI mouse event binding.
Logesh M (@logeshM1) Voice Command Engine Lead python/voice_wakeword.py
python/voice_engine.py
python/voice_mapping.py
Background audio capture, “CHIRAVOX” wakeword monitor, Hugging Face Whisper ASR transcription, shortcut mapper.
Muthamil V (@muthamil13) FastAPI Backend GUI Server Lead python/config.py
python/gui_server.py
python/main.py
File lock thread safety on config JSONs, FastAPI REST & WebSockets JPEG stream, system CLI launcher menu.
Godfrey T R (@TheOrionGD) React Settings & Trainer SPA Lead Frontend/ React Application Vite React SPA layout, WebSocket HTML5 Canvas video feed renderer, voice controller status component, form bindings.

System Architecture & Data Flow

CHIRAVOX’s architecture separates tasks into distinct background daemon threads. Visual tracking, speech transcription, configuration management, and the API server run concurrently, sharing state via configuration files and thread-safe queues.

+------------------+     +--------------------+     +-------------------+
|  Webcam Input    | --> | OpenCV/MediaPipe   | --> | PyAutoGUI Mouse   |
|  (30+ FPS Frame) |     | Landmark Engine    |     | Event Execution   |
+------------------+     +--------------------+     +-------------------+
                                                               ^
+------------------+     +--------------------+               |
|  Mic Audio       | --> | Hugging Face       | --------------+
|  (Local Stream)  |     | Whisper STT Engine |
+------------------+     +--------------------+

Thread Communication & Data Flow

graph TD
    A[Webcam Feed cv2] --> B(python/camera.py)
    B --> C(python/gesture_engine.py)
    C -->|21 landmarks coordinates| D(python/gesture_mapping.py)
    D -->|Coordinate Smoothing| E{PyAutoGUI Event}
    
    F[Mic Stream sounddevice] --> G(python/voice_wakeword.py)
    G -->|Trigger: 'CHIRAVOX'| H(python/voice_engine.py)
    H -->|ASR Whisper Transcription| I(python/voice_mapping.py)
    I -->|Keyboard Hotkeys| E
    
    J(python/config.py) -->|Thread Lock Settings| K[chiravox_settings.json]
    K -->|Read Thresholds| D
    K -->|Read Wakeword Config| G
    
    L(python/gui_server.py) -->|REST API & WS| M[React Frontend Client]
    M -->|GET/POST Settings| L
    L -->|Update Settings| J

Data Processing Pipeline

  1. Webcam Frame Capture: OpenCV captures a raw BGR frame at 30+ FPS.
  2. Pre-processing: Frame is mirrored (flipped) and converted to RGB color space.
  3. Hand Detection: MediaPipe locates 21 3D landmark coordinates on the hand.
  4. Gesture Logic: Python checks finger extension states and landmark Euclidean distances.
  5. Coordinate Mapping: NumPy interpolates index finger position to screen resolution.
  6. Smoothing Filter: Moving average buffer removes hand tremor jitter.
  7. Mouse Execution: PyAutoGUI issues OS-level pointer or hotkey events.
  8. UI Overlay: Annotated frame delivery to WebSocket clients at 30 FPS.

Folder & Component Structure

Chiravox/
├── README.md                        # Primary documentation & architecture guide
├── LICENSE                          # MIT open-source license
├── chiravox_settings.json             # System configurations and thresholds database
├── chiravox_custom_gestures.json      # Saved custom trained hand poses database
├── requirements.txt                 # Python dependencies manifest
├── run_chiravox.ps1                   # PowerShell automated launcher script
├── python/                          # Python backend daemon files
│   ├── main.py                      (CLI launcher interface & menu)
│   ├── config.py                    (Thread-safe settings manager)
│   ├── camera.py                    (OpenCV webcam frame capture loop)
│   ├── gesture_engine.py            (MediaPipe hand landmarker engine)
│   ├── gesture_mapping.py           (PyAutoGUI mouse movements and coordinates filter)
│   ├── voice_wakeword.py            (Background audio wakeword monitor)
│   ├── voice_engine.py              (Hugging Face speech-to-text pipeline)
│   ├── voice_mapping.py             (Shortcut and command execution mapper)
│   └── gui_server.py                (FastAPI REST & WebSockets server)
├── Frontend/                        # React frontend client
│   ├── package.json                 # Node package manifest
│   ├── vite.config.js               # Vite configuration proxying requests to port 8000
│   ├── index.html                   # HTML SPA template
│   └── src/                         # React components & styles
│       ├── main.jsx                 # Client entry point
│       ├── App.jsx                  # Main router navigation wrapper
│       ├── index.css                # CSS variables, glassmorphism, and dark theme
│       └── components/              # Modular UI view components
│           ├── Dashboard.jsx        (System Overview & status KPIs)
│           ├── Trainer.jsx          (Gesture Trainer & canvas recorder)
│           ├── VoiceController.jsx  (Voice engine controls & logs)
│           ├── Settings.jsx         (Configuration sliders and options)
│           └── CommandPalette.jsx   (Searchable command modal)
└── tests/                           # Unit & Integration test suites
    ├── test_api.py                  (FastAPI REST endpoint tests)
    ├── test_camera.py               (OpenCV capture & setting tests)
    ├── test_config.py               (SettingsManager CRUD & fallback tests)
    ├── test_gesture_mapping.py      (Finger states & posture heuristic tests)
    └── test_voice_mapping.py        (Command matching & alias tests)

Core Gesture Engine & Gesture Catalog

CHIRAVOX tracks 21 3D coordinates on the hand, using landmark spatial relationships to classify gestures.

       8   12  16  20
       |   |   |   |
       7   11  15  19
   4   |   |   |   |
   |   6   10  14  18
   3   \___|___|___/
    \      5   9  13 17
     2      \  |  /  /
      \      \ | /  /
       1______\|/  /
              |   /
              0__/

Complete 22 Gesture Catalog

Cursor & Click

| Gesture | Description | Action | | :— | :— | :— | | ☝️ Index Finger Up | Only index finger extended, hand moves freely | Move Cursor | | 🤏 Quick Pinch | Index + thumb touch and release | Left Click | | 🤏🤏 Double Pinch | Two rapid pinches within 0.35s | Double Click | | ✊ Hold Pinch + Move | Pinch held >0.6s while moving hand | Drag & Drop | | 🖕 Middle + Thumb Pinch | Middle finger + thumb touch | Right Click | | 🤌 Ring + Thumb Pinch | Ring finger + thumb touch | Middle Click | | 👌 OK Sign | Index + thumb form circle, other fingers extended | Confirm / Enter Key |

Scrolling & Navigation

| Gesture | Description | Action | | :— | :— | :— | | ✌️ Two Fingers Up + Move | Index & middle extended, move up/down | Vertical Scroll | | ✌️↔ Two Fingers Lateral | Index & middle extended, move left/right | Horizontal Scroll | | 👋 Wrist Flick Left | Quick leftward wrist snap (index up) | Navigate Back | | 👋 Wrist Flick Right | Quick rightward wrist snap (index up) | Navigate Forward | | ☝️⬆ Index Hold Up (1s) | Index up, hand stationary for 1 second | Page Up | | ☝️⬇ Index Hold Down (1s) | Index down, hand stationary for 1 second | Page Down |

Zoom

| Gesture | Description | Action | | :— | :— | :— | | 🤏➡ Pinch Expand | Thumb & index spread outward rapidly | Zoom In (Ctrl +) | | 🤏⬅ Pinch Contract | Thumb & index pinch inward rapidly | Zoom Out (Ctrl -) |

Window Management

| Gesture | Description | Action | | :— | :— | :— | | 🖖 V-Spread | Index & middle spread wide apart | Switch Window (Alt+Tab) | | ✊ Closed Fist (still) | All fingers curled, no movement for 0.5s | Minimize Window | | 🖐 Four Fingers Up | All fingers except thumb extended | Close Window (Alt+F4) | | 🤟 Spider-Man Pose | Thumb + index + pinky extended | Open Start Menu |

System Controls

| Gesture | Description | Action | | :— | :— | :— | | ✋ Open Palm | All 5 fingers extended, hand still | Freeze / Rest Mode | | 🤙 Shaka Sign | Thumb + pinky extended | Toggle Voice Mode | | 🤞 Crossed Fingers | Index + middle crossed | Lock Screen |


Voice Command Engine & Command Catalog

CHIRAVOX transcribes speech locally using Hugging Face’s transformers library (openai/whisper-tiny).

40+ Voice Commands Catalog

Category Commands
Editing "copy", "cut", "paste", "undo", "redo", "select all", "save", "save as", "find", "replace", "delete", "bold", "italic", "underline", "new line"
Navigation "scroll up", "scroll down", "scroll top", "scroll bottom", "go back", "go forward", "page up", "page down", "zoom in", "zoom out", "reset zoom"
Window & Tab "close tab", "new tab", "reopen tab", "next tab", "previous tab", "new window", "close window", "switch window", "minimize", "maximize", "restore", "task view", "snap left", "snap right"
Media & Volume "volume up", "volume down", "mute", "unmute", "play", "pause", "play pause", "next track", "previous track", "fullscreen", "exit fullscreen"
System & Apps "screenshot", "open explorer", "show desktop", "lock screen", "open settings", "task manager", "open notepad", "open calculator"
CHIRAVOX Control "start listening", "stop listening", "open trainer", "open settings", "toggle gestures", "calibrate", "help"

Settings GUI & Gesture Trainer

Settings GUI

The React-based settings dashboard enables users to configure system parameters without code edits:

Gesture Trainer

The Gesture Trainer features a real-time HTML5 Canvas preview fed via WebSockets (/trainer/stream). Users can:

  1. Hold a custom hand posture in front of the webcam.
  2. Observe live 5-finger extended/curled state indicators.
  3. Enter a custom gesture name and map it to a system action.
  4. Hit Record (3-second countdown) to save custom postures to chiravox_custom_gestures.json.

API & WebSocket Specifications

REST API Endpoints

WebSocket Streams


Configuration Schema

chiravox_settings.json

{
  "camera_index": 0,
  "cursor_smoothing": 5,
  "click_threshold_px": 30,
  "drag_hold_time_sec": 0.6,
  "double_click_time_sec": 0.35,
  "cooldown_period_sec": 0.3,
  "voice_commands_enabled": true,
  "gesture_trainer_enabled": true
}

System Requirements

Hardware Requirements

Software & Environment


Installation & Deployment

Quick Start (Automated PowerShell Script)

.\run_chiravox.ps1

Manual Installation Steps

# 1. Clone repository
git clone https://github.com/your-org/Chiravox.git
cd Chiravox

# 2. Set up Python virtual environment & dependencies
python -m venv .venv
.venv\Scripts\activate      # Windows
pip install -r requirements.txt

# 3. Build React Frontend SPA
cd Frontend
npm install
npm run build
cd ..

# 4. Launch CHIRAVOX Launcher Menu
python python/main.py

Verification & Testing

Running Full Automated Test Suites

1. Python Unit & API Test Suite

python -m unittest discover -s tests -p "test_*.py"

(Runs 24 unit & API endpoint tests covering settings CRUD, gesture heuristics, voice mappings, and REST endpoints).

2. JavaScript / Frontend Test Suite

cd Frontend
npm test

(Runs Vitest / Node test suite validating metadata schemas and API utilities).


Challenges, Mitigations & Future Roadmap

Challenge / Risk Mitigation Strategy
Cursor Jitter Moving average smoothing buffer (configurable 1–15 frames).
Accidental Clicks Configurable cooldown timer + Euclidean click distance threshold.
Poor Lighting Confidence threshold tuning; recommend adequate front lighting.
Gorilla Arm Fatigue Rest Mode (“Open Palm”) gesture suspends active mouse updates.
Background Noise Signal RMS threshold check before triggering Whisper ASR.

Future Enhancements


Development Roadmap (14-Day Timeline)


Contributors & Licensing

Project Contributors

License

CHIRAVOX is open-source software released under the terms of the MIT License.