A Rock-Paper-Scissors Pygame with a CNN Multiclass Classifier model built in Keras to recognize real-time hand gestures using OpenCV.
This game simply uses your computer's camera to capture realtime gestures of your hand.
The pictures taken by the camera are processed and fed to a CNN Multi-class image classifier that determines whether the gesture corresponds to "Rock", "Paper" or "Scissors" gesture.
This CNN model is made in keras. You can download the pretrained model from here & the dataset from this drive link.
After completing a couple of CNN courses on coursera I wanted to hone my skills by focusing on a small project. So I found 2 useful datasets and jumped straight into building my model. I didnt want to stop there... this led me to create my first pygame. I'm happy with my progress and would like to share it with you.
1. Clone the repository
git clone <this_repo_url>
2. Start a virtual environment eg. conda (Recommended)
conda activate <my_virtual_env>
3. Download the requirements
cd Rock-Paper-Scissors-OpenCV
pip install requirements.txt
4. Download the model
.
├───models # model.h5 files here
├───notebooks
│ └───.ipynb_checkpoints
├───readme_requirements
│ └───video
├───src
│ ├───components
│ │ └───__pycache__
│ └───utils
│ ├───images
│ └───__pycache__
└───tests
├───integration
└───unit
5. Run the game
python src/main.py
Round 1 | Round 2 | Round 3 |
---|---|---|
Round 4 | Round 5 | Round 6 |
Command Line Output |
---|
- Create a CNN Multi-Class Classifier
- Integrate it with OpenCV
- Create my 1st Pygame
- Structure Code!
- Work more on the model
- Fix bugs & Add comments to code
CNN Links :
- The best way to get started -> Convolutional Neural Networks by Andrew Ng
Pygame Links :
- Pygame Docs or even this Pygame Guide
- A Basic Pygame Tutorial
© 2020 Darlene Nazareth