CSCE 643 - Fall 2021 Eye gaze detection using neural networks. LeNet-based model used to train on the MPIIGAZE dataset. Head pose-independent and dependent gaze estimation is implemented.
Trained model is then utilized for webcam gaze inference using a 6-point face model and Perspective-n-Point solver.
Also see project_report.pdf.
Operating system: Ubuntu 21.04 Programming Language: Python 3.9.7
- Clone repository
git clone - Install requirements
pip install -r requirements.txt
- Download Dlib trained face detection model from https://github.com/davisking/dlib-models/blob/master/shape_predictor_68_face_landmarks.dat.bz2 and place it in the
assets/directory. - Switch to the
codedirectory:cd code/ - Calibrate camera matrix
python calibrate_cam.py - Run webcam inference code
python webcam_gaze.py- To use head pose dependent model, modifications in utils_webcam.py's estimate_gaze and webcam_gaze.py's model definitions needed.
- Download MPIIGAZE dataset from http://datasets.d2.mpi-inf.mpg.de/MPIIGaze/MPIIGaze.tar.gz and place the extracted directory
MPIIGAZEalong with its contents in thedata/directory. - Switch to the
codedirectory:cd code/ - Set training configuration as desired in
train.py - Train the model:
python train.py- The trained model will overwrite the existing pretrained model in
assets/models/unless the path is changed. - To train other models, use the following:
- Head pose-dependent LeNet:
python train_other_LeNet.py - Head pose-dependent AlexNet:
python train_other_AlexNet.py
- Head pose-dependent LeNet:
- The trained model will overwrite the existing pretrained model in