Control your computer with hand gestures! A Python application that uses computer vision to detect hand gestures and launch applications via webcam.
โจ Features
- ๐ฏ Real-time hand detection using Googleโs MediaPipe
- ๐ Finger counting (0-5 fingers) for gesture recognition
- ๐ Customizable app launching via JSON configuration
- โฑ๏ธ 5-second cooldown to prevent accidental launches
- ๐น Visual feedback with hand landmarks overlay
- ๐จ Clean interface showing gesture status and available commands
- โ๏ธ Easy configuration - edit gestures without touching code
๐ฎ Default Gestures
| Gesture | Fingers | Action |
|---|---|---|
| โ Fist | 0 | Open Terminal |
| โ๏ธ Point | 1 | Open File Manager |
| โ๏ธ Peace | 2 | Open Firefox |
| ๐ค Three | 3 | Open VS Code |
| ๐ Four | 4 | Open Text Editor |
| โ Open Hand | 5 | Open Thunderbird |
๐ ๏ธ Technology Stack
- Python 3.11+ - Core language
- OpenCV - Computer vision and camera handling
- MediaPipe - Googleโs hand detection and tracking
- JSON - Configuration management
- subprocess - Application launching
๐ Quick Start
- Clone the repository
git clone https://github.com/vl43den/goreallymental.git cd goreallymental - Set up Python environment
conda create -n gesture_env python=3.11 conda activate gesture_env conda install -c conda-forge opencv pip install mediapipe - Run the application
python gesture_launcher.py - Start gesturing! โ
- Position your hand in front of the webcam
- Hold up fingers (0-5) to trigger actions
- Press ESC to exit
โ๏ธ Customization
The application uses a gestures.json file to map finger counts to shell commands. You can easily customize which applications launch for each gesture:
{
"0": "gnome-terminal",
"1": "nautilus ~/Documents",
"2": "firefox https://github.com",
"3": "code .",
"4": "gedit",
"5": "spotify"
}
๐ง Technical Implementation
- Hand Detection: MediaPipe Hands solution with 21 landmark points
- Finger Detection: Compares fingertip Y-coordinates with joint positions
- Thumb Special Case: Uses X-coordinate comparison for thumb detection
- Performance: 30+ FPS processing with minimal CPU usage
- Cooldown:
time.monotonic()for precise timing
๐ License
This project is licensed under the MIT License - making it free to use, modify, and distribute.
๐ฏ Use Cases
- Accessibility: Hands-free computer control
- Presentations: Launch applications without touching keyboard
- Demo purposes: Impressive computer vision showcase
- Development: Learning OpenCV and MediaPipe
- Automation: Quick access to frequently used applications
Made with luv and Python