Object Detection
LiteRT
LiteRT
LiteRT
on-device
android
gpu
face-detection
yunet
libfacedetection
landmarks
Instructions to use litert-community/YuNet-Face-LiteRT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- LiteRT
How to use litert-community/YuNet-Face-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
YuNet face detection LiteRT fp16 (fully-GPU, Pixel 8a corr 0.9999, 4ms, 0.3MB)
Browse files- .gitattributes +1 -0
- README.md +45 -0
- samples/sample.png +3 -0
- yunet_fp16.tflite +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,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: bsd-3-clause
|
| 3 |
+
library_name: LiteRT
|
| 4 |
+
pipeline_tag: object-detection
|
| 5 |
+
tags: [litert, tflite, on-device, android, gpu, face-detection, yunet, libfacedetection, landmarks]
|
| 6 |
+
base_model: ShiqiYu/libfacedetection
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# YuNet — LiteRT (on-device face detection, fully-GPU)
|
| 10 |
+
|
| 11 |
+
[YuNet](https://github.com/ShiqiYu/libfacedetection) (ShiqiYu/libfacedetection), a tiny fast face detector
|
| 12 |
+
(faces + 5 landmarks), converted to **LiteRT** and running **fully on the `CompiledModel` GPU** (ML Drift) on
|
| 13 |
+
Android. **0.076 M params / 0.3 MB fp16.**
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
|
| 17 |
+
## On-device (Pixel 8a, Tensor G3 — verified)
|
| 18 |
+
|
| 19 |
+
| | |
|
| 20 |
+
|---|---|
|
| 21 |
+
| nodes on GPU | **146 / 146** LITERT_CL (full residency) |
|
| 22 |
+
| inference | **~4 ms** (640×640) |
|
| 23 |
+
| size | **0.3 MB** (fp16) |
|
| 24 |
+
| accuracy | device-vs-PyTorch corr **0.9999** (all 12 outputs) |
|
| 25 |
+
|
| 26 |
+
```
|
| 27 |
+
image[1,3,640,640] (BGR, 0-255) →[GPU: YuNet]→ 12 outputs: cls/obj/bbox/kps × strides {8,16,32}
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
## How it converts (litert-torch) — clean, no re-authoring
|
| 31 |
+
|
| 32 |
+
Pure CNN (depthwise-separable `ConvDPUnit`) + a **nearest-upsample** neck (`F.interpolate(mode="nearest")` →
|
| 33 |
+
`RESIZE_NEAREST_NEIGHBOR`, no transposed conv) + non-padded `MaxPool2d` (no `PADV2`). The head's per-stride
|
| 34 |
+
`permute/reshape/sigmoid` is baked in → 12 decode-ready outputs. Banned ops NONE, ≤4D, tflite-vs-torch corr
|
| 35 |
+
**1.0**, device-vs-torch corr **0.9999**.
|
| 36 |
+
|
| 37 |
+
## Decode (host-side) & preprocessing
|
| 38 |
+
|
| 39 |
+
**Preprocessing**: letterbox to 640×640, **BGR, 0-255, no normalization**. Anchor-free priors
|
| 40 |
+
(`px=col·s, py=row·s`, offset 0): score=`cls·obj`, box=center+`exp(wh)·s`, 5 landmarks `kps·s+prior`, then NMS.
|
| 41 |
+
|
| 42 |
+
## License
|
| 43 |
+
|
| 44 |
+
[BSD-3-Clause](https://github.com/ShiqiYu/libfacedetection/blob/master/LICENSE). Upstream:
|
| 45 |
+
[ShiqiYu/libfacedetection](https://github.com/ShiqiYu/libfacedetection).
|
samples/sample.png
ADDED
|
Git LFS Details
|
yunet_fp16.tflite
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ced5f52bef6e76ad4a66d1055b2b404336ceafbae8eeac8fed6aa9c7b2e4d776
|
| 3 |
+
size 256228
|