Skip to main content

Hand Gesture Engine

A modular, extensible hand gesture recognition engine built in Python using MediaPipe landmarks. Designed for real-time applications, clean architecture, and easy integration into games, apps, and AI projects. Perfect for:

  • Computer Vision projects
  • Gesture-controlled apps
  • Games & UI interaction
  • esearch & prototyping

Features

  • Modular gesture detection system
  • Real-time hand landmark processing
  • Centralized gesture recognizer (brain logic)
  • Configurable thresholds (pinch, thumb, etc.)
  • Built-in logging (debug & production ready)
  • CPU / GPU backend auto-selection
  • Clean project structure
  • YAML configuration support
  • Confidence scoring
  • Stable public API
  • Ready for extension with custom gestures

Supported Gestrues

Gesture Name Returned
✊ Fist FIST
✋ Open Hand OPEN HAND
👍 Thumbs Up THUMBS UP
👎 Thumbs Down THUMBS DOWN
✌ Peace PEACE
☝ Pointing POINTING
👌 OK OK
🤏 Pinch PINCH
🖖 Three Fingers THREE

Installation

pip install mediapipe opencv-python

Then:

pip install hand-gesture-engine==0.1.1

Quick Start

Sample Code:

import cv2
from hand_gesture import GestureEngine, GestureConfig

config = GestureConfig.from_yaml("gesture_config.yaml")
engine = GestureEngine(config=config)

cap = cv2.VideoCapture(0)

while cap.isOpened():
    ret, frame = cap.read()
    if not ret:
        break

    frame, gesture = engine.process(frame)

    if gesture:
        print("Detected:", gesture)

    cv2.imshow("Gesture Engine", frame)
    if cv2.waitKey(1) == 27:
        break

Configuration

IMPORTANT:

Add/Create gesture_config.yaml in the same working directory:

backend: AUTO

stability:
  hold_time: 0.35
  min_confidence: 0.6

thresholds:
  pinch: 0.04
  thumb_extended: 0.25
  finger_tolerance: 0.05

GerstureEngine

engine = GestureEngine(
    backend="AUTO",  # AUTO | CPU | GPU
    config=config
)
Backends
AUTO - selects best available backend
CPU - forced CPU execution
GPU - uses GPU if supported

Logging

Enable logging via config:

GestureConfig(enable_logging=True)

Logs include:

  • Backend selection
  • Detection failures
  • Gesture recognition results

Future Ideas

Roadmap

  • Gesture smoothing
  • Multi-hand support
  • Custom gesture training
  • Mobile optimization
  • ONNX / TensorRT backend

Credit

https://choosealicense.com/
This site helps you choose an open source license for your repository/project.
You can get to know about the licenses and which license to choose.
Very useful!

Author

Karan Vishwakarma
Built with Python and Mediapipe(Google)

License

MIT License
Free to use, modify, and distribute.

Final Note

If this project helps you:

  • Star it on GitHub
  • Share it on PyPI
  • Build cool gesture-powered apps

Metadata

Release files for hand-gesture-engine 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hand-gesture-engine 0.1.1
File Size Uploaded
hand_gesture_engine-0.1.1.tar.gz 5.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for hand-gesture-engine 0.1.1
File Interpreter ABI Platform
hand_gesture_engine-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 MB

Release files / hand_gesture_engine-0.1.1.tar.gz

Download URL hand_gesture_engine-0.1.1.tar.gz
Size 5.8 MB
Tags Source
SHA-256 checksum
How to use checksums
30d8f7fcb89caf4382a87fa0e8a64b76b0a614d363ba2bf2a395722dd8bbd371
BLAKE2b-256 checksum
How to use checksums
c1f9ff857435f434acc5a7b59050f6fb28b939757ea8d7c2c97d2160b7d61b9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0

Release files / hand_gesture_engine-0.1.1-py3-none-any.whl

Download URL hand_gesture_engine-0.1.1-py3-none-any.whl
Size 9.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7baf8af27bfe435ee416b4ef99371f21b6aa056cc0aa7832bb847c7687fb02dd
BLAKE2b-256 checksum
How to use checksums
20c31e8a9ea84a48ad403e55f437cbc765075913c27e7b54c02da27b0aab8843
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page