Skip to content

This project is a hand-gesture-controlled Pong game using TensorFlow, OpenCV, and Pygame. It detects open hands via webcam in real time to control paddles, combining AI vision with interactive gameplay for a novel touchless experience.

Notifications You must be signed in to change notification settings

aimaster-dev/pong-motion-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

15 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โœ‹ 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
git clone https://github.com/yourusername/pong-motion-control.git
cd pong-motion-control
  1. Install dependencies
pip install pygame opencv-python tensorflow numpy
  1. Add your pre-trained TensorFlow model to src/pretrained_model.pb

โ–ถ๏ธ Run the Game

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.

About

This project is a hand-gesture-controlled Pong game using TensorFlow, OpenCV, and Pygame. It detects open hands via webcam in real time to control paddles, combining AI vision with interactive gameplay for a novel touchless experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages