Instructions to use py-feat/l2cs with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Py-Feat
How to use py-feat/l2cs with Py-Feat:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Add model card with attribution
Browse files
README.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: py-feat
|
| 3 |
+
pipeline_tag: image-classification
|
| 4 |
+
tags:
|
| 5 |
+
- gaze-estimation
|
| 6 |
+
license: mit
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# L2CS-Net (Gaze Estimation)
|
| 10 |
+
|
| 11 |
+
## Model Description
|
| 12 |
+
|
| 13 |
+
L2CS-Net regresses gaze direction (pitch, yaw) from a face crop. It
|
| 14 |
+
formulates gaze estimation as a 90-bin classification problem over each
|
| 15 |
+
axis (4°/bin resolution covering [-180°, +180°]), then computes the
|
| 16 |
+
expected value across bins for a continuous angle output. ResNet50
|
| 17 |
+
backbone, two parallel FC heads.
|
| 18 |
+
|
| 19 |
+
Reported accuracy (from the original L2CS-Net paper):
|
| 20 |
+
- Gaze360 test split: ~3.92° MAE
|
| 21 |
+
- MPIIFaceGaze leave-one-out: ~4.16° MAE
|
| 22 |
+
|
| 23 |
+
These are state-of-the-art numbers for gaze-from-face-crop estimation
|
| 24 |
+
(2022); for context, geometric iris-eye approaches typically land at
|
| 25 |
+
8-15° MAE on the same benchmarks.
|
| 26 |
+
|
| 27 |
+
## Model Details
|
| 28 |
+
|
| 29 |
+
- **Architecture**: ResNet50 + dual classification heads (2 × 90-bin)
|
| 30 |
+
- **Input**: 224 × 224 RGB face crop, ImageNet-normalized
|
| 31 |
+
- **Output**: pitch, yaw in radians (head-centric frame)
|
| 32 |
+
- **Bin resolution**: 4° per bin, covering [-180°, +180°]
|
| 33 |
+
- **Backbones available**: ResNet50 (default), ResNet18 (lighter)
|
| 34 |
+
- **Framework**: PyTorch (port of upstream MIT code)
|
| 35 |
+
|
| 36 |
+
## Training data (upstream)
|
| 37 |
+
|
| 38 |
+
- **Gaze360** (Kellnhofer et al., 2019): in-the-wild gaze annotations
|
| 39 |
+
with 360° head pose coverage. ~127k images.
|
| 40 |
+
- **MPIIFaceGaze** (Zhang et al., 2017): unconstrained office captures
|
| 41 |
+
with screen-targeted gaze ground truth. ~213k images.
|
| 42 |
+
|
| 43 |
+
The upstream maintainer trains separate checkpoints for each dataset.
|
| 44 |
+
Py-Feat exposes the **Gaze360** weights as the default since they
|
| 45 |
+
generalize better to in-the-wild input.
|
| 46 |
+
|
| 47 |
+
## Model Sources
|
| 48 |
+
|
| 49 |
+
- **Original repository (MIT)**: [Ahmednull/L2CS-Net](https://github.com/Ahmednull/L2CS-Net)
|
| 50 |
+
- **Paper**: [arXiv:2203.03339](https://arxiv.org/abs/2203.03339)
|
| 51 |
+
- **Pretrained weights (upstream)**: Google Drive folder linked from the
|
| 52 |
+
upstream README (`L2CSNet_gaze360.pkl`). Py-Feat hosts a re-packaged
|
| 53 |
+
`.safetensors` version on this repo to avoid the pickle (`.pkl`)
|
| 54 |
+
deserialization path on user machines. The conversion is documented
|
| 55 |
+
at `scripts/convert_l2cs_pickle_to_safetensors.py` in the py-feat
|
| 56 |
+
repo; no architecture or weight values are modified.
|
| 57 |
+
|
| 58 |
+
## Acknowledgements
|
| 59 |
+
|
| 60 |
+
This distribution is a **re-host** of the official L2CS-Net weights
|
| 61 |
+
trained by Abdelrahman, Hempel, Khalifa, and Al-Hamadi (Otto-von-Guericke
|
| 62 |
+
University Magdeburg). All training, hyperparameter selection, and
|
| 63 |
+
benchmark numbers are credited to the original authors. The py-feat
|
| 64 |
+
project provides only:
|
| 65 |
+
- A PyTorch port of the inference code at `feat/gaze_detectors/l2cs/l2cs_model.py`
|
| 66 |
+
- This re-packaged `.safetensors` artifact for downstream safety
|
| 67 |
+
- Integration with `feat.Detector` and `feat.MPDetector`'s pipelines
|
| 68 |
+
|
| 69 |
+
Training data are credited to:
|
| 70 |
+
- Gaze360 — Kellnhofer, Recasens, Stent, Matusik, Torralba (MIT)
|
| 71 |
+
- MPIIFaceGaze — Zhang, Sugano, Fritz, Bulling (MPI Saarbrücken)
|
| 72 |
+
|
| 73 |
+
## Citation
|
| 74 |
+
|
| 75 |
+
```bibtex
|
| 76 |
+
@article{l2csnet2022,
|
| 77 |
+
title={L2CS-Net: Fine-Grained Gaze Estimation in Unconstrained Environments},
|
| 78 |
+
author={Abdelrahman, Ahmed and Hempel, Thorsten and Khalifa, Aly and
|
| 79 |
+
Al-Hamadi, Ayoub},
|
| 80 |
+
journal={arXiv preprint arXiv:2203.03339},
|
| 81 |
+
year={2022}
|
| 82 |
+
}
|
| 83 |
+
```
|
| 84 |
+
|
| 85 |
+
## License
|
| 86 |
+
|
| 87 |
+
MIT — both the original implementation and the converted weights. See
|
| 88 |
+
[upstream LICENSE](https://github.com/Ahmednull/L2CS-Net/blob/main/LICENSE).
|
| 89 |
+
Training data licenses (Gaze360, MPIIFaceGaze) are research-use only;
|
| 90 |
+
commercial deployment may require separate validation.
|