esimov / pigo-face-tracking

Play games with your head. A face tracking application using the Pigo library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pigo-face-tracking

CI License

Real time face tracking application using the Pigo face detection library to convert face movements into keyboard actions like UP, DOWN, LEFT, RIGHT. This means you can play games without being physically attached to a keyboard device or you can navigate through your web browser like you would navigate with the arrow keys.

This is achieved due to the library high performance facial landmark points detection capabilities.

Screen capture

How does it work?

The Pigo library is capable of high accuracy facial landmark points detection, but out of the existing 15 facial landmark points the nose provides the best accuracy for face tracking, so this has been used to track the head movement. When a head movement is detected a keyboard press event is triggered through the OS system events as you would press the key physically.

Install

Notice: at least Go 1.13 is required!

$ go get -u -v github.com/esimov/pigo-face-tracking

Run

To run it is as simple as to type a single make command from the project root directory:

  1. This will spawn a new web server listening on localhost:5000, will start the webcam and track your head movement continuously.
  2. Now find some Atari like online games and start playing. https://m.plonga.com/ is one of the options.
  3. Move your head as you would play with the arrow keys.

OS Support

This program has been tested on Linux and MacOS, but normally it should also run on Windows.

Because of the OS imposed security constrains there are some important steps you need to take:

MacOS:

In MacOS you must set the accessibility authorization for the terminal you are running from.

Linux:

On Linux the library used for triggering the keyboard events uses uinput, which on the major distributions requires root permissions. The easy solution is running the command with sudo. Another, but not recommended approach is to change the executable's permissions by using chmod. For this reason you can run the accompanied permission.sh shell file.

Author

License

Copyright © 2020 Endre Simo

This software is distributed under the MIT license. See the LICENSE file for the full license text.

About

Play games with your head. A face tracking application using the Pigo library.

License:MIT License


Languages

Language:Go 92.9%Language:HTML 3.7%Language:Makefile 2.3%Language:Shell 1.1%