Skip to the content.

✋ Hand Gesture Volume Control (MacOS)

This project is a real-time hand gesture recognition system using PyTorch and OpenCV that lets you control music playback and system volume on macOS using your webcam.

🎯 Features

🤖 Gesture-to-Action Mapping

| Gesture   | Action           |
|-----------|------------------|
| `rock`    | Play             |
| `palm`    | Pause            |
| `like`    | Volume Up        |
| `dislike` | Volume Down      |
| `ok`      | Wait (no action) |
| `fist`    | Stop             |

🧱 Project Structure

hand_gesture_cnn/
├── checkpoints/              # Saved model weights
│   └── best_model.pth
├── models/
│   └── model.py              # HandGestureCNN architecture
├── live_demo/
│   ├── webcam_predict.py     # Basic live webcam classification
│   └── webcam_volume_control.py # Music and volume control logic

🛠 Want more?

Check out webcam_volume_control.py to control your system with gestures!

🛠 Requirements

📦 Install Dependencies

pip install torch torchvision opencv-python osascript

🚀 Run the Volume Control Script

From the project root:

python live_demo/webcam_volume_control.py

🧠 Tip: Make sure your virtual environment is activated and Music.app is open.

✅ To Do / Ideas

🙌 Credits


🖐 Built with creativity and a MacBook by Marcos Hernandez —