To use your own webcam for real-time gaze estimation:
-
Build NMS, Sim3DR and mesh render in 3DDFA_V2 (Thanks to this amazing work!)
---> cd ./TDDFA_V2/
---> sh ./build.sh
-
Calibrate subject-specific features
---> Set cfg.EasyCali.subj_idx
---> Set cfg.EasyCali.to_save to True (Recommend to False before getting ready to start)
---> Run calibration/capture_images.py (Should fixate at the camera lens center and move your head freely, then press "s" on keyboard to capture 50 images continuously)
---> Set camera intrinsic parameters in camera_intrinsic_params.py (Calibrate the webcam before)
---> Run calibration/camera_intrinsic_params.py
---> Run calibrate_features.py (Set cfg.EasyCali.visualize to True to check the gaze lines)
-
Real-time gaze estimation
---> Set cfg.eye_mask_type to simple for higher fps if needed
---> Set cfg.render to True for facial shape visualization if needed
---> Run demo_webcam.py
The 3D face model reconstruction in this work is modified from 3DDFA_V2.