A lightweight hand gesture recognition engine
Project description
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
)
BackendsAUTO - 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hand_gesture_engine-0.1.1.tar.gz.
File metadata
- Download URL: hand_gesture_engine-0.1.1.tar.gz
- Upload date:
- Size: 5.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30d8f7fcb89caf4382a87fa0e8a64b76b0a614d363ba2bf2a395722dd8bbd371
|
|
| MD5 |
3d9de9bdc3af834c3b72b448c962a247
|
|
| BLAKE2b-256 |
c1f9ff857435f434acc5a7b59050f6fb28b939757ea8d7c2c97d2160b7d61b9f
|
File details
Details for the file hand_gesture_engine-0.1.1-py3-none-any.whl.
File metadata
- Download URL: hand_gesture_engine-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7baf8af27bfe435ee416b4ef99371f21b6aa056cc0aa7832bb847c7687fb02dd
|
|
| MD5 |
b811f8c7907cc15736da6a063eea8de7
|
|
| BLAKE2b-256 |
20c31e8a9ea84a48ad403e55f437cbc765075913c27e7b54c02da27b0aab8843
|