Skip to content

paruby/snake-face

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1e570e1 Β· Sep 12, 2021

History

25 Commits
Apr 26, 2020
Apr 27, 2020
Apr 26, 2020
Sep 12, 2021

Repository files navigation

Snake face

Keyboards are for losers -- play snake by moving your head!

Play live: https://paruby.github.io/snake-face/

demo

How does this work?

I use the tensorflow.js model MediaPipe Facemesh to estimate the head pose in real time using the device's camera. When the game starts, the direction in which the head is pointing is estimated as a reference point. Subsequent estimates during game play are compared to this to decide which direction to steer the snake.

The head direction is estimated by calculating the vectors connecting the centre of the lips to the left and right cheeks. These two vectors lie on a plane that approximates the surface of the face. The cross product of these vectors is normal to this plane and thus points approximately in the direction of the head.

You can read more about this here: http://paulrubenstein.co.uk/blog/

About

🐍 Play snake using your face! β¬…οΈπŸ˜ƒβž‘οΈ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages