Press any key with your smile
https://www.youtube.com/watch?v=M9rMs4U_d3A
Assume you cloned and inside the directory.
- Get Python 3 and install ydotool
- As normal user: Create virtual environment:
python -m venv ./.venv
- As normal user: Get into the virtual environment:
. ./.venv/bin/activate
- As normal user:
pip install mediapipe python-ydotool
- As normal user:
wget -O face_landmarker.task -q https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task
- As root:
ydotoold --socket-path=/tmp/.ydotool_socket --socket-own="$(id -u YOUR_USERNAME_FOR_NORMAL_USER):$(id -g YOUR_USERNAME_FOR_NORMAL_USER)"
- As normal user: Run
python ./main.py --frameWidth=600 --frameHeight=400
. The lower value for--frameWidth=
and--frameHeight
, the more FPS you get.
Basically, it's a mediapipe example for facial landmarks.
Pros:
- It works
Cons:
- Input is emulated on Linux via uinput kernel's module, needs a little rewrite to work on other operational systems.
- It seems to not be accelerated on Nvidia GPUs because of mediapipe. Not that big of a problem to be honest, if set lower values for frame size to take via camera.
- When you use it, it seems to take control of camera, so I couldn't use camera from other apps like OBS. Though, I could show my camera output and record the window on OBS, so it's just an inconvinience
MIT