Skip to content

Instantly share code, notes, and snippets.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@skeeet
skeeet / gaze_tracker.py
Created June 12, 2024 09:09 — forked from AndreVallestero/gaze_tracker.py
Fast, real-time gaze tracker using mediapipe and python (faster than dlib or openface)
# https://youtu.be/DNKAvDeqH_Y
# https://google.github.io/mediapipe/solutions/iris.html#ml-pipeline
# https://google.github.io/mediapipe/solutions/face_mesh.html#python-solution-api
import cv2 as cv
import numpy as np
from mediapipe import solutions
LEFT_IRIS = [pair[0] for pair in solutions.face_mesh.FACEMESH_LEFT_IRIS]
RIGHT_IRIS = [pair[0] for pair in solutions.face_mesh.FACEMESH_RIGHT_IRIS]