ML Project By Kshitij M Bhat, Bhavya Dalal and Tanishq Selot for IITISoC'21
Mentors - Aryan Rastogi, Bharat Gupta, Sakshee Patil, Kashish Bansal
Description: Implementing a simple game using CV.
For Mid-Evaluation, we have built a model to classify hand images as rock, paper and scissors. We primarily used Python along with Tensorflow and Keras Packages. We employed Convolutional Neural Networks (CNNs) to build this model. We tackled overfitting using Data augmentation. 80% : 20% Training-Validation split. The dataset we used for this model is Tensorflow Rock-Paper-Scissors Images.
Input size of images - 300x300
Training Accuracy - 97.52%
Validation Accuracy - 99.40%
Test Accuracy - 94.35%
F1 Score - 94.95%
All the code for mid-eval can be accessed in the ML7_RockPaperScissors.ipynb file. It can be easily run in any IPython notebook editor.
Some correctly predicted images :
For the final submission:
OpenCV file - RockPaperScissor.py
Pygame file - main.py
We used OpenCV for taking the input from the user via the webcam and labelling it using the classifier model. The computer randomly selects (no chance of bias) an image against the human opponent and the applies the conditional statement to predict that who should get the point. The Pygame gaming interface is used to display the responses and it also shows the scoreboard at real-time. The interface looks like :