https://github.com/aimaster-dev/pong-motion-control
https://github.com/aimaster-dev/pong-motion-control
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aimaster-dev/pong-motion-control
- Owner: aimaster-dev
- Created: 2025-05-15T15:45:12.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-05-15T17:28:46.000Z (9 months ago)
- Last Synced: 2025-05-15T17:48:09.883Z (9 months ago)
- Language: Python
- Size: 23.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# โ Pong Game with Hand Gesture Control
This is an AI-powered Pong game that uses real-time hand gesture recognition to control paddles using your webcam. Open hands detected on either side of the screen move the paddles up or down โ no keyboard or mouse needed!

Demo
---
## ๐ฎ Features
- Real-time hand detection with **TensorFlow** and pre-trained model
- Gesture-based paddle movement (open hand = move)
- Split-screen detection for two-player interaction
- Pong gameplay with paddle & ball physics in **Pygame**
- Overlays interactive regions and visual cues using **OpenCV**
---
## ๐ง Technologies Used
- **TensorFlow** for hand detection
- **OpenCV** for camera feed and visualization
- **Pygame** for game mechanics
- **NumPy** for image and numerical operations
---
## ๐ ๏ธ Installation
1. Clone this repository
```bash
git clone https://github.com/yourusername/pong-motion-control.git
cd pong-motion-control
````
2. Install dependencies
```bash
pip install pygame opencv-python tensorflow numpy
```
3. Add your pre-trained TensorFlow model to `src/pretrained_model.pb`
---
## โถ๏ธ Run the Game
```bash
python main.py
```
Press `SPACE` to start the game
Press `ESC` to exit
---
## ๐ฏ Controls
* Open your hand in the **top area** โ Move paddle **up**
* Open your hand in the **bottom area** โ Move paddle **down**
Left hand = Player 1
Right hand = Player 2
---
## ๐ File Structure
```
โโโ main.py # Main game file
โโโ src/
โ โโโ utils.py # Hand detection and prediction utilities
โ โโโ pretrained_model.pb # TensorFlow frozen inference graph
```
---
## ๐งช Notes
* Ensure your webcam is working and well-lit
* You can adjust thresholds and chunk size in the `FLAGS`
---
## ๐ License
MIT License โ use, modify, and play freely!
---
## ๐ค Inspired by
Gesture-based gaming, AI-powered interfaces, and classic Pong nostalgia.