A web application that classifies images of hand gestures as rock, paper, or scissors using a machine learning model.
This project uses the Rock-Paper-Scissors dataset from Kaggle.
- Python 3.11
- TensorFlow 2.x
- Flask
- Pillow (PIL)
-
Clone the repository:
git clone https://github.com/zave52/rock-paper-scissors-classification.git cd rock-paper-scissors-classification -
Install Git LFS: This repository uses Git Large File Storage (LFS) for the model files.
- Install Git LFS following the official instructions
- After installation, set up LFS and pull the model files:
git lfs install git lfs pull
-
Create and activate a virtual environment (optional but recommended):
python3 -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Create environment variables:
cp .env.sample .env
Then edit the
.envfile with your settings. -
Make sure the directory structure includes:
static/uploads/for uploaded imagesstatic/models/with the trained model file
-
Activate your virtual environment if you're using one:
source venv/bin/activate # On Windows, use: venv\Scripts\activate
-
Start the Flask development server:
flask run
-
Open your web browser and navigate to:
http://127.0.0.1:5000/
- Upload an image of a hand showing either rock, paper, or scissors gesture
- The application will predict which gesture is shown in the image
- Results are displayed with the predicted class and confidence score
app.py: Flask application entry pointclassifier.py: Image classification logicstatic/: Static files (CSS, JS, models, uploaded images)templates/: HTML templatesrequirements.txt: Project dependencies

