ptgaze MPIIGaze model (resnet_preact)
Appearance-based gaze estimation model used by the mpiigaze mode of ptgaze. It takes a normalized grayscale eye image (36x60) together with the normalized 2D head pose and predicts the gaze direction as pitch and yaw angles in the normalized space, following Zhang et al. (MPIIGaze, TPAMI 2019).
Model details
- Architecture: 8-layer preactivation ResNet, defined in
ptgaze/models/mpiigaze/resnet_preact.py - Input: 1x36x60 normalized eye image (grayscale, values in [0, 1]) and a 2-element normalized head pose (pitch, yaw). The model works in the left-eye convention; right eyes are mirrored on input.
- Output: gaze (pitch, yaw) in the normalized camera space
- Training code: hysts/pytorch_mpiigaze
- Format: safetensors, converted from the original
.pthcheckpoint withptgaze-convert(tensor-identical). The file metadata recordsmode: MPIIGazeandmodel: resnet_preact.
The input normalization must match the conventions the training labels were generated with. See the notes on data normalization in the demo README.
Accuracy
Mean test angle error of 5.73 degrees with leave-one-person-out evaluation on MPIIGaze (from the training repo results).
Usage
pip install ptgaze
ptgaze --mode mpiigaze
The demo downloads this file automatically. To inspect the weights directly:
from safetensors.torch import load_file
state_dict = load_file("model.safetensors")
Training data
This model was trained on the MPIIGaze dataset, which is distributed under CC BY-NC-SA 4.0 (non-commercial). The model was trained for research purposes.
The dataset license binds the dataset recipient; it does not automatically extend to users of these weights. However, the legal status of model weights trained on datasets with restrictive terms is not settled. If you intend to use this model commercially, assess that risk yourself.
License
MIT, the same license as the ptgaze code (see the LICENSE file in this repository). The license covers the rights the author holds in these weights; see the Training data section above for the terms of the dataset they were trained on.
Citation
If you use this model, please cite the dataset paper:
Zhang, Xucong, Yusuke Sugano, Mario Fritz, and Andreas Bulling. "MPIIGaze: Real-World Dataset and Deep Appearance-Based Gaze Estimation." IEEE Transactions on Pattern Analysis and Machine Intelligence 41 (2019). arXiv:1711.09017