← Back to Projects

🤚 Hand Gesture Recognition

Real-time AI-powered computer vision for intuitive human-computer interaction

Python 3.7+ OpenCV 4.8+ MediaPipe 0.10+ MIT License
⭐ View on GitHub
9+
Gesture Types
30+
FPS Real-time
95%
Accuracy
<50ms
Latency

Features

🤚

Real-time Hand Detection

Uses MediaPipe for accurate hand tracking with 21 landmark points per hand

🎯

Multiple Gesture Recognition

Supports 9+ different hand gestures including thumbs up, peace sign, fist, and more

🧠

ML-Based Training

Train custom gestures with machine learning using Random Forest classifier

🎮

Interactive Applications

Control computer, play games, and automate tasks with hand gestures

🎭

Demo Mode

Test gesture recognition without camera access for demonstrations

📊

Debug Tools

Visualize finger detection and gesture analysis in real-time

Supported Gestures

Fist

All fingers closed

👍

Thumbs Up

Only thumb extended

👉

Pointing

Only index finger

✌️

Peace Sign / Two

Index + middle fingers

🔫

Gun

Thumb + index fingers

🤟

Rock On

Thumb + pinky fingers

3️⃣

Three

Index + middle + ring

4️⃣

Four

All fingers except thumb

Open Palm

All fingers extended

Installation

git clone https://github.com/jaswanth-mjy/hand-gesture-recognition.git
cd hand-gesture-recognition
pip install -r requirements.txt
python3 main.py

Tech Stack

Python 3.7+ OpenCV (Computer Vision) MediaPipe (Hand Detection) NumPy (Numerical Computation) scikit-learn (Machine Learning) PyAutoGUI (System Control)

Applications

💻

Computer Control

Control mouse cursor, keyboard inputs, system volume, and brightness with hand gestures

🎮

Interactive Game

Play Rock Paper Scissors and other gesture-based games

🎨

Custom Training

Collect data and train ML models for custom gesture recognition

Technical Details

Architecture

  • MediaPipe: Hand landmark detection (21 points per hand)
  • OpenCV: Computer vision and camera handling
  • scikit-learn: Machine learning for custom gesture training
  • NumPy: Numerical computations for gesture analysis

Performance

  • Speed: ~30 FPS real-time processing
  • Accuracy: 85-95% depending on lighting and hand position
  • Latency: <50ms gesture recognition
  • Hands: Supports up to 2 hands simultaneously

Quick Start

from gesture_recognition import HandGestureRecognizer

recognizer = HandGestureRecognizer()
recognizer.run_camera()

Troubleshooting

Camera Issues

  • Grant camera permissions in system settings
  • Ensure no other apps are using the camera
  • Try different camera index (0, 1, 2...)

Performance Issues

  • Improve lighting conditions
  • Clean camera lens
  • Close other applications
  • Reduce video resolution

Recognition Issues

  • Position hand clearly in view
  • Avoid complex backgrounds
  • Maintain steady hand positions
  • Use debug mode to see detection

Ready to Get Started?

Clone the repository and start building gesture-controlled applications!

⭐ View on GitHub