A computer vision-based game that detects two players and their hand gestures to play Rock Paper Scissors Lizard Spock.
- Player detection using YOLOv8
- Automatic screen division for two players
- Hand gesture recognition using MediaPipe and machine learning
- Real-time game play with visual feedback
-
Install the required packages:
pip install -r requirements.txt -
Run the game:
python main.py -
Select an option:
- 1: Start the full game with player detection
- 2: Test only the player detection
- 3: Exit
- Two players need to be visible on the camera
- Once detected, each player makes hand gestures on their side of the screen
- The game will identify the gestures and determine the winner based on the rules:
- Rock crushes Scissors and Lizard
- Paper covers Rock and disproves Spock
- Scissors cuts Paper and decapitates Lizard
- Lizard poisons Spock and eats Paper
- Spock smashes Scissors and vaporizes Rock
- Python 3.8+
- Webcam
- Sufficient lighting for player and hand detection
- The YOLOv8 model will be downloaded automatically on first run (~15MB)
- For best results, ensure both players are clearly visible with good lighting