
Show HN: Play snake by moving your head - ml_basics
https://github.com/paruby/snake-face
======
ml_basics
Link to demo: [https://paruby.github.io/snake-
face/](https://paruby.github.io/snake-face/)

------
blotter_paper
This is cool!

I appreciate the printed direction under the video of my face, but I feel like
it might have been a little bit easier for me to learn to direct it if there
was also a face mesh drawn on the displayed camera frame as debug info. This
has seemed to allow me to adjust easier to facial controls in the past, and
other people I polled about the helpfulness of displaying such debug info to
the end user seemed to overwhelmingly agree (polls were of about 20 people,
and super unscientific -- this is essentially still anecdotal advice to be
taken with a grain of salt, but I got literally no negative reactions).

As an example of how this could help learning, I jumped straight to the demo
without really reading the instructions (hurpadurpa), and I foolishly assumed
that you were just detecting head position in the frame and using the
coordinates, rather than the direction my face was pointing, to determine
control direction. It wasn't until I looked at the code that I realised what I
was doing wrong. I probably could have read more and picked up on this without
diving into the code, but I also probably would have picked it up immediately
if I saw a mesh of some facial landmarks (rather than assuming an invisible
bounding box). I think smaller adjustments would be assisted as well -- the
user can figure out how far off screen their face can go while still being a
face way easier if you show them what you think looks like a face.

Another maybe-helpful-maybe-not thought: adding an additional direction
indicator to the art in the main game screen might make it easier to get used
to the controls as well, and let the user know exactly when they trigger a
change in direction without drawing their eyes away from the action. This
could be as simple as two pixels for eyes on the snake head.

~~~
ml_basics
Thanks a lot for the detailed feedback, that's really helpful!

------
sairamkunala
You should rename the title to 'snake game with free head streches'

------
fpopa
I did a similar thing, but used left / right head tilting for scrolling the
page.

Reading and peeling oranges became easier.

------
roll57
There is a tutorial about that
[https://www.youtube.com/watch?v=UPgxnGC8oBU](https://www.youtube.com/watch?v=UPgxnGC8oBU)

~~~
ml_basics
Very cool, but that video works by using normal supervised learning (to detect
hand gestures) while mine detects the direction your face is pointing in using
pose estimation.

Edit: I didn't train the pose estimation model myself, it's taken from a
tensorflow.js example: [https://github.com/tensorflow/tfjs-
models/tree/master/faceme...](https://github.com/tensorflow/tfjs-
models/tree/master/facemesh)

~~~
imglorp
How hard would it be to use these tools to detect someone touching their face
and throwing a chime to help remind them not to? It could run in the
background all day for laptop/webcam users. #covid etc.

~~~
johnmoberg
Check this out:
[https://news.ycombinator.com/item?id=22548708](https://news.ycombinator.com/item?id=22548708)

~~~
imglorp
Yeah, that!

------
sleepychu
Very impressive! Callibration took a fair minute or two but I didn't have to
do anything complicated like show it all the different poses.

Fun couple of games. I had trouble getting it to recognise down but I think
that's because I can't bend my neck forward and keep looking at the screen
(glasses) to see the snake moving.

Also I am definitely team: Screen edge should wrap around!

~~~
ml_basics
Thanks for the feedback, I will take it into account for v2!

------
thereyougo
Great way to discover muscles you didn't know you had

------
jbverschoor
I think I need a beard for this to work.

------
xiphias2
Lots of fun, but my head hurts a bit :)

~~~
jahn716
Yea, I had to stop after scoring 5

------
nallo
Keep making these things for me. :)

------
caspx
Vero cool

------
syx
this is very nice and fun!

