An interactive RockβPaperβScissors game built using Computer Vision and Hand Gesture Recognition.
The playerβs move is detected in real time using a webcam, while an AI opponent plays against you.
This project uses OpenCV, MediaPipe, and CVZone to create a fun, responsive, and visually clean gaming experience.
- Real-time hand gesture detection
- AI opponent with random move selection
- Countdown-based round system
- Live score tracking (Player vs AI)
- Clean & modern UI using OpenCV overlays
- Restart and replay rounds easily
- Works directly with your webcam
| Gesture | Move |
|---|---|
| β Fist | Rock |
| β Open Palm | Paper |
| βοΈ Index + Middle Finger | Scissors |
- Python 3.10
- OpenCV
- MediaPipe
- CVZone
- NumPy
Rock_Paper_Scissor/ β βββ data/ β βββ bg.png # Background UI β βββ rock.png # AI rock image β βββ paper.png # AI paper image β βββ scissor.png # AI scissor image β βββ main.py # Game logic βββ requirements.txt # Dependencies βββ .gitignore βββ README.md
Please use Python 3.10.x for best compatibility with MediaPipe.
git clone https://github.com/Mohataseem89/Computer-Vision-RPS.git
cd Computer-Vision-RPS
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
python main.pyProject inspired by learning from Murtaza Hassan: Github