EyePy is an eye tracking library easily implementable in your projcets
MIT License
This is a Python library that provides webcam-based eye tracking. Extract facial features, train eye tracking model and predict gaze with super easy to use interface.
Clone this project:
git clone https://github.com/ck-zhang/EyePy
pip install -r requirements.txt
python demo.py
pip install uv
uv sync
uv run demo.py
from EyePy import GazeEstimator
gaze_estimator = GazeEstimator()
import cv2
image = cv2.imread('image.jpg')
features, blink_detected = gaze_estimator.extract_features(image)
if blink_detected:
print("Blink detected!")
else:
print(features)
X = [...] # Features
y = [...] # Gaze coordinates
gaze_estimator.train(X, y)
predicted_gaze = gaze_estimator.predict([features])
print(predicted_gaze)
Any suggestions for features and improvements are welcome.
If you enjoyed using EyePy, consider giving it a star.