gaze
Webcam gaze estimation: from an ordinary webcam frame, predicts where on the screen you are looking, after a 4-dot calibration (the screen corners). Runs in the browser with onnxruntime-web (WebGPU or wasm).
- Code and browser demo: https://github.com/kkrausse/gaze
- Built on Meta's Sapiens2 0.4B (image backbone) with transformer blocks that combine the frame with the calibration frames.
- Not trained on MPIIFaceGaze, UT Multiview or EVE (non-commercial datasets). A variant that is: kkrausse/gaze-nc, non-commercial use only.
- This checkpoint:
m91c(2026-11-21). The previous version,m69(9-dot calibration), is kept under the tagm69.
Files
| file | what |
|---|---|
model.json |
everything the demo needs to run the graphs (window layout, bins, file list, input conventions) |
xattn.onnx + xattn.onnx.data |
per-frame graph, fp16 (fp32: xattn.fp32.onnx + .data) |
kv.onnx |
once per calibration: the calibration frames' keys and values, fp16 (fp32: kv.fp32.onnx) |
xattn.q8.onnx + .data, kv.q8.onnx |
the same graphs with 8-bit weights (MatMulNBits, block 128), fp16 compute: 363 MB instead of 705 |
xattn.q8.fp32.onnx + .data, kv.q8.fp32.onnx |
8-bit weights, fp32 compute (wasm / GPUs without shader-f16): 374 MB instead of 1.4 GB |
Inputs and outputs are described in the code repository. model.json's aux_scale_rel: the frame's log crop-scale
input is given relative to the calibration frames (minus their mean).
Evaluation
Mean gaze-point error on the screen, in mm, after calibration. Same frames and protocol for every column; single training seed each.
| held-out set | n | gaze m91c, 4 dots |
gaze m69, 4 dots |
gaze m69, 9 dots |
gaze-nc m68, 9 dots |
|---|---|---|---|---|---|
| Webcam sessions, locked test (never used to pick a model) | 55 sessions, 1068 dots | 21.2 | 23.6 | 21.1 | 18.0 |
| Webcam sessions, standard test | 19 sessions, 480 dots | 18.1 | 19.8 | 17.3 |
- The webcam sessions are one person at one ~300 mm-wide laptop-size screen, with MacBook, phone and Sony cameras at about 50 cm (21 mm is about 2.3 degrees there).
- m91c with 4 corner dots matches m69 with 9 dots on the locked test, and is 2.4 mm better than m69 given the same 4 dots. The standard test was used to choose between training recipes, so its numbers favour newer models; the locked test is the fair comparison.
- The public datasets (MPIIFaceGaze, UT Multiview, EVE) were not re-scored for m91c; m69's cross-dataset numbers are
on the
m69tag's card. - The 8-bit files change the gaze point by 0.14 mm on average (about as much as fp16 does) and leave the held-out error unchanged (17.71 vs 17.71 mm on the 19 standard sessions); the demo loads them by default.
- Without calibration the models are far off (75-110 mm): calibration is required.
Licence
These weights are a derivative of Sapiens2 and are distributed under the Sapiens2 License (LICENSE.md, Meta):
commercial use is allowed under its terms, including its restrictions (trade controls, prohibited uses, privacy and
biometric-data law). The code in the GitHub repository is MIT.
Model tree for kkrausse/gaze
Base model
facebook/sapiens2-pretrain-0.4b