Instructions to use litert-community/L2CS-Gaze360-LiteRT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/L2CS-Gaze360-LiteRT with LiteRT:
# 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
L2CS-Net gaze360 LiteRT fp16 (fully-GPU, Pixel 8a corr 0.9999, 3ms)
Browse files- .gitattributes +1 -0
- README.md +50 -0
- gaze_fp16.tflite +3 -0
- samples/sample.png +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
samples/sample.png filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: LiteRT
|
| 4 |
+
pipeline_tag: image-classification
|
| 5 |
+
tags: [litert, tflite, on-device, android, gpu, gaze-estimation, l2cs, resnet, gaze360]
|
| 6 |
+
base_model: Ahmednull/L2CS-Net
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# L2CS-Net — LiteRT (on-device gaze estimation, fully-GPU)
|
| 10 |
+
|
| 11 |
+
[L2CS-Net](https://github.com/Ahmednull/L2CS-Net) (Ahmednull) gaze estimation, converted to **LiteRT** and
|
| 12 |
+
running **fully on the `CompiledModel` GPU** (ML Drift) on Android. Predicts where a centered face is looking
|
| 13 |
+
(yaw/pitch). ResNet50 backbone trained on Gaze360.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
|
| 17 |
+
## On-device (Pixel 8a, Tensor G3 — verified)
|
| 18 |
+
|
| 19 |
+
| | |
|
| 20 |
+
|---|---|
|
| 21 |
+
| nodes on GPU | **139 / 139** LITERT_CL (full residency) |
|
| 22 |
+
| inference | **~3 ms** (448×448) |
|
| 23 |
+
| size | 47.9 MB (fp16) |
|
| 24 |
+
| accuracy | device-vs-PyTorch corr **0.9999**, gaze angle within ~0.1° |
|
| 25 |
+
|
| 26 |
+
```
|
| 27 |
+
face[1,3,448,448] (ImageNet-normalized) →[GPU: ResNet50]→ yaw[1,90], pitch[1,90] (softmax over angle bins)
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
The 90 bins span [-180,180]° (4° each); gaze angle = softmax expectation `Σ p_i·i · 4 − 180` (softmax baked in).
|
| 31 |
+
|
| 32 |
+
## How it converts (litert-torch)
|
| 33 |
+
|
| 34 |
+
Pure CNN (ResNet50 + 2 FC heads). Two numerically-exact ResNet fixes:
|
| 35 |
+
1. **stem `MaxPool2d(3,s2,p1)` → zero-pad + valid max-pool** — PyTorch's max-pool pads with `-inf` → a `PADV2`
|
| 36 |
+
the Mali delegate won't delegate (compile fail); since the pool follows a ReLU, a 0-pad is exactly
|
| 37 |
+
equivalent → `PAD`, full GPU residency.
|
| 38 |
+
2. **global `AdaptiveAvgPool2d(1)` → `mean(3).mean(2)`**.
|
| 39 |
+
|
| 40 |
+
Result: banned ops NONE, all tensors ≤4D, tflite-vs-torch corr **1.0**, device-vs-torch corr **0.9999**.
|
| 41 |
+
|
| 42 |
+
## Preprocessing & decode
|
| 43 |
+
|
| 44 |
+
Center-crop to a (centered) face, resize 448×448, /255, ImageNet mean/std, NCHW. Decode: softmax expectation
|
| 45 |
+
over the 90 bins → yaw/pitch degrees → gaze direction.
|
| 46 |
+
|
| 47 |
+
## License
|
| 48 |
+
|
| 49 |
+
[MIT](https://github.com/Ahmednull/L2CS-Net/blob/main/LICENSE). Upstream:
|
| 50 |
+
[Ahmednull/L2CS-Net](https://github.com/Ahmednull/L2CS-Net).
|
gaze_fp16.tflite
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b16a8158ec0e252ee105e717177149655a60b71c8a1eccd97b873bf640c2a13d
|
| 3 |
+
size 47868896
|
samples/sample.png
ADDED
|
Git LFS Details
|