https://github.com/yamii07/volume-controller-hand-gestures
A Python-based volume controller using OpenCV and MediaPipe that allows you to control your system volume with simple hand gestures via webcam.
https://github.com/yamii07/volume-controller-hand-gestures
ai hand-detection mediapipe-hands object-detection opencv2 pycaw python3 volume-control
Last synced: 8 months ago
JSON representation
A Python-based volume controller using OpenCV and MediaPipe that allows you to control your system volume with simple hand gestures via webcam.
- Host: GitHub
- URL: https://github.com/yamii07/volume-controller-hand-gestures
- Owner: Yamii07
- License: mit
- Created: 2025-05-11T13:48:32.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-05-11T14:00:50.000Z (8 months ago)
- Last Synced: 2025-05-11T14:42:34.591Z (8 months ago)
- Topics: ai, hand-detection, mediapipe-hands, object-detection, opencv2, pycaw, python3, volume-control
- Language: Python
- Homepage:
- Size: 0 Bytes
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🎚️ Hand Gesture Volume Controller
A Python-based volume controller using **OpenCV** and **MediaPipe** that allows you to control your system volume with simple hand gestures via webcam.
---
## 🛠️ Features
- 📷 Real-time hand tracking using MediaPipe
- ✋ Control system volume by changing the distance between your thumb and index finger
- 🔊 Visual feedback for volume level on screen
- 🧠 Intuitive gesture-based interface
---
## 📦 Dependencies
Install the required libraries:
```bash
pip install opencv-python mediapipe numpy pycaw comtypes
```
> **Note:** `pycaw` only works on Windows.
---
## 🚀 How to Run
1. Clone the repository:
```bash
git clone https://github.com/Yamii07/volume-controller-hand-gestures.git
cd volume-controller-hand-gestures
```
2. Run the script:
```bash
python volume_control.py
```
3. Show your hand to the webcam and pinch your **thumb and index finger** to adjust the volume.
---
## 🧠 How It Works
- **MediaPipe** detects hand landmarks in real time.
- Calculates the distance between **landmark 4 (thumb tip)** and **landmark 8 (index finger tip)**.
- Maps that distance to a system volume range (0% - 100%).
- Adjusts volume using **pycaw** on Windows.
---
## 📁 Project Structure
```
volume-controller-hand-gestures/
├── htmmod.py # Modules for main File
├── volume_control.py # Main script
├── README.md # Project documentation
```
---
## ✅ Requirements
- 3.6 < Python < 3.12
- Webcam
- Windows OS (required for volume control)
---
## 👨💻 Author
**Purshottam Kumar**
GitHub: [@Yamii07](https://github.com/Yamii07)
---
## 📄 License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.