Inspiration
A few of my friends used Teachable Machines to recognize people who were wearing a mask and who were not, so this made me think if I could use this same technology to create a game.
What it does
Let's you use your hand to play rock paper scissors against a computer.
How we built it
To begin with, I used Teachable Machines to create the "AI" of the game that would recognize your hand gestures. After downloading the "AI" as a keras file which is provided by Teachable machines, I used cv2 (a module in OpenCV) to access my camera and CAPTURE an image of me doing a hand gesture (rock, paper or scissors). Once cv2 captures my image, I save it and run it through the tensorflow.keras which gives me an output of either Rock, Paper or Scissors. Now that I have the result of the gesture I had given, I made a computer that would randomly choose between the three options. Then, I ran the result which was provided by tensorflow.keras through a simple game logic that follows the rules of Rock Paper Scissors to decide who won the game. I put this all together using Pygame to create a simple GUI.
Challenges I ran into
The hardest challenge I ran into was trying to get the "AI" to properly recognize between "Rock" and "Scissors". To overcome this, I decided to increase the number of data points the "AI" uses to figure out which one of the three hand gestures it is. Although this did increase the accuracy of the AI, it did not make it 100% accurate meaning that it might still think you have played scissors even if your hand gesture is in the form of a rock.
Accomplishments that I am proud of
I am proud of how the final project looks and can recognize the hand gestures better than what I had begun within the first place.
What I learned
I learnt how to use tensorflow, OpenCV, numpy and PILLOW to the best of my abilities.
What's next for Rock Paper Scissors AI
I hope to create more games using this AI technology provided by Teachable Machines
Built With
- ai
- gui
- keras
- python
- rock-paper-scissors
- tensorflow
Log in or sign up for Devpost to join the conversation.