A collection of Computer Vision (CV) projects exploring Human-Computer Interaction (HCI), real-time object detection, and AI-powered automation using Python, OpenCV, MediaPipe, and YOLO.
This repository currently contains:
- 🎵 Hand Gesture Music Controller
- 🚗 YOLO Real-Time Vehicle Counter
.
├── hand_music_controller.py
├── car_counter.py
├── requirements.txt
├── mysong.mp3
├── yolov8n.pt
└── README.md
- Real-time hand tracking using MediaPipe
- Detects finger positions from webcam input
- Plays music when an open hand is detected
- Stops music when a closed fist is detected
- Lightweight and CPU-friendly
-
Real-time vehicle detection using YOLOv8 Nano
-
Detects:
- 🚗 Cars
- 🏍️ Motorcycles
- 🚌 Buses
- 🚚 Trucks
-
Live bounding boxes
-
Vehicle counting
-
Works with webcam or video files
-
Optimized for CPU execution
Install the required system packages:
sudo apt update
sudo apt install \
python3-venv \
python3-pip \
libgl1-mesa-glx \
libasound2-dev -ypython3 -m venv cv_envActivate it:
source cv_env/bin/activatecv_env\Scripts\activatepip install -r requirements.txtControl music playback using simple hand gestures captured by your webcam.
| Gesture | Action |
|---|---|
| ✋ Open Hand | Play music |
| ✊ Closed Fist | Stop music |
MediaPipe detects 21 hand landmarks.
Finger states are determined using landmark coordinates.
Because image coordinates start at the top-left corner, a raised finger has a smaller Y coordinate than its lower joint.
The rule used is:
Finger Tip Y < Finger PIP Y
↓
Finger is UP
Place your music file in the project directory:
mysong.mp3
Then run:
python hand_music_controller.pyA lightweight vehicle detection system powered by YOLOv8 Nano.
- Capture webcam/video frame
- Run YOLOv8 inference
- Filter vehicle classes
- Draw bounding boxes
- Display live vehicle count
Supported COCO classes:
| Class | ID |
|---|---|
| Car | 2 |
| Motorcycle | 3 |
| Bus | 5 |
| Truck | 7 |
python car_counter.pyTo use a video instead of the webcam, change:
source = 0to:
source = "traffic.mp4"- Python
- OpenCV
- MediaPipe
- YOLOv8 (Ultralytics)
- NumPy
- Pygame
This repository is designed to work efficiently on systems without NVIDIA GPUs.
Benefits include:
- Smaller installation size
- Reduced dependency footprint
- Faster setup
- Lower memory usage
- Ideal for laptops and virtual machines
- Swipe gesture detection
- Volume control using finger distance
- Gesture-based media controls
- Multi-hand support
- ROI (Region of Interest) counting
- Object tracking across frames
- Vehicle speed estimation
- Lane-wise analytics
- Traffic statistics dashboard
| Project | Description |
|---|---|
| 🎵 Hand Gesture Music Controller | Control music with hand gestures |
| 🚗 YOLO Vehicle Counter | Detect and count vehicles in real time |
Contributions, ideas, and improvements are welcome.
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a Pull Request
This project is licensed under the MIT License.
Feel free to use, modify, and share it for educational and personal projects.
If you found this repository useful, consider giving it a ⭐ Star on GitHub. It helps others discover the project and motivates future improvements.