This project presents a captivating rendition of the classic game "Rock Paper Scissors," employing hand gesture recognition through the Mediapipe AI model. Users can engage in dynamic gameplay against the computer, with seamless navigation facilitated by an intuitive user interface.
To get started with the project, follow these steps:
-
Clone the repository to your local machine.
-
Navigate to the root folder of the project.
-
Install the required dependencies using the following command:
pip install -r requirements.txt
- Optional:
-
If you want to store the streak in a database, create a MySQL database using the database.sql file located in the database folder. You can use the following command in the MySQL command line interface:
source database\db.sql
-
After creating the database, modify the values related to the database connection in the main.py file. Update the mydb variable with your database credentials.
-
- Navigate to the
start folder
located inside the root folder. - Run
index.html
located in the start folder to initiate the experience. - If you haven't created an account yet, run
signup.py
located in thesignup
folder to create an account. Alternatively, if you already have an account, proceed to the next step. - If you have an account, run
login.py
located in thelogin
folder to log in to your account.
- Alternatively, you can skip the entire process by simply running index.html in the root folder. This allows you to play the game directly with the computer without using any additional features.
Sign-Up Page | Login Page |
![]() |
![]() |
Main Page | Data stored in a Database |
![]() |
![]() |
-
Gesture Recognition: Utilizes Mediapipe's AI model to detect hand gestures, enabling intuitive gameplay.
-
User Authentication: Users can log in, sign up, or directly start playing without authentication.
-
Automatic Page Navigation: Upon launching
index.html
, users are seamlessly directed to their desired pages. -
Database Integration: Stores user scores, including streak, in a MySQL database, ensuring persistence and scalability.
-
Cookie-Based Session Management: Account information is transmitted across pages using browser cookies.
-
database: Contains the database file
database.sql
for storing user scores. -
images: Stores PNG images used to display the computer's decisions (rock, paper, etc.).
-
login: Holds files related to the login page, including
index.html
,styles.css
, andscript.js
. -
menu_page: Contains files for the menu page, including
index.html
,styles.css
, andscript.js
. -
signup: Includes files for the signup page, including
index.html
,styles.css
, andscript.js
. -
start: Consists of files for the start page, including
index.html
,styles.css
, andscript.js
. -
main.py: Python script responsible for backend logic and database interaction.
-
index.html: HTML file for the root page of the project.
User Win Image | System Win image |
![]() |
![]() |
-
Immersive Experience: The project offers an immersive gameplay experience through gesture-based interaction.
-
Efficiency: Leveraging asynchronous I/O and real-time communication enhances performance and responsiveness.
-
Scalability: With database integration, the project can scale effectively to accommodate a growing user base.
-
Accessibility: Users can seamlessly navigate through the interface, fostering an inclusive and enjoyable experience.
-
Mediapipe: Facilitates hand tracking and gesture recognition. Detects hand gestures from the user's camera for intuitive interaction in the game Using a machine learning model. Website
-
Asyncio: For asynchronous I/O, enabling efficient handling of concurrent operations. Website
-
Websockets: Facilitates real-time communication between client and server. Website
-
MySQL Connector: Connects Python to MySQL database for data storage and retrieval. Website
-
JSON: Utilized for data interchange between client and server. Website