Teachable Snake

June 2019 | By Vince MingPu Shao

Classic snake game controlled by webcam image using pre-trained neural network models.


Video Play Button

Teachable Snake is an interactive web game powered by the beta version of Teachable Machine 2 and React.js, inspired by Webcam Pacman project.

The idea is to instead of using physical buttons to control the game, everyone can draw a black arrow on a piece of white paper as controller, and move the snake by turning the paper in different directions in front of webcam.

To recognize the paper controller pointing at different directions, I pre-trained the model with 500 photos each arrow direction (up, down, right and left), and store the model in cloud with the beta version of Teachable Machine 2. With the API endpoint published, I can then apply the model in my React.js app.