On-device LiteRT (.tflite) conversion of
lightweight-OpenPose
for human pose estimation. The model is a MobileNet-based heatmap network; it outputs
keypoint heatmaps only and the keypoint decode (argmax) is done in app code.
The model runs fully on the LiteRT CompiledModel GPU accelerator (ML Drift): every op is
GPU-native, no CPU fallback. Converted with
litert-torchwith no patches.
Why heatmaps-only: MoveNet's official .tflite bakes the keypoint decode into the graph
(GATHER_ND), which the GPU delegate can't run — so it only partially offloads to the GPU.
Keeping the graph pure-conv and decoding in app code keeps it 100% on the GPU.
Output: [1, 32, 32, 19] float32, NHWC, keypoint heatmaps (18 body keypoints +
background). Argmax each of the 18 keypoint channels over the 32 x 32 grid to get the
normalized keypoint locations; connect them into a skeleton.
This is a weights-exact format conversion of the public Lightweight OpenPose model; no
new training was performed. It was trained for 2D human-pose estimation on the COCO 2017
keypoints dataset (web photos of people with keypoint annotations). These images contain
people; the model outputs anonymous keypoint coordinates only and performs no
identification. No PII was deliberately collected and this conversion adds none. Apply your
own content/PII handling as appropriate. See the original
lightweight-human-pose-estimation
repo for dataset details.
Performance
Measured on a Pixel 8a (Tensor G3, Android 16) with the standard TFLite benchmark_model tool — 10 warm-up runs then 50 timed runs, reported as the tool's mean.
Any on-device figure recorded when this model shipped came from a different runtime. It was taken through LiteRT's own CompiledModel accelerator (logcat reports it as LITERT_CL), which is the path the Kotlin sample app and the LiteRT API use, and it appears elsewhere on this card. The rows above are the classic TFLite OpenCL delegate, measured with a tool anyone can download and re-run. The two are not comparable, so read the rows above as a reproducible floor rather than as this model's speed on LiteRT.
XNNPACK declines these fp16 graphs — it reports failed to delegate DEPTHWISE_CONV_2D and then fails to allocate tensors — so there is no usable CPU number. Disabling XNNPACK falls back to reference kernels, which measured about 20× slower than the GPU on models of this size and would not represent CPU inference anyone would ship.
Snapdragon NPU (Hexagon)
pose_256.tflite — the NPU is 2.70x faster than the GPU (1.34 ms against 3.62 ms) and loads 4.78x faster (106 ms against 508 ms).
pose_256_fp16.tflite — the NPU is 2.69x faster than the GPU (1.36 ms against 3.66 ms) and loads 5.02x faster (105 ms against 525 ms).
file
backend
compiled
inference (median / min)
load
pose_256.tflite
NPU (Hexagon v81)
on-device JIT
1.34 ms / 1.30 ms
106 ms
pose_256.tflite
GPU (Adreno)
—
3.62 ms / 3.13 ms
508 ms
pose_256_fp16.tflite
NPU (Hexagon v81)
on-device JIT
1.36 ms / 1.34 ms
105 ms
pose_256_fp16.tflite
GPU (Adreno)
—
3.66 ms / 3.19 ms
525 ms
Measured on a Samsung Galaxy S26 (Snapdragon 8 Elite Gen 5 / SM8850, Hexagon v81, Android 16) with LiteRT CompiledModel 2.2.0, one accelerator per process, 5 warm-up runs then N=50 timed runs, median reported. Every run held thermal status NONE throughout. Headroom 0.79–0.81, where 1.0 is the throttling threshold.
The NPU rows ran the published file unchanged. LiteRT compiled it for the Hexagon on the device at first load. Those first compiles took 723 ms to 884 ms here. The load column above is the cached load every later run pays. Recipe and the runtime libraries it needs: NPU guide.
Measured on a Raspberry Pi 5 Model B Rev 1.1 (8 GB, Raspberry Pi OS 64-bit) with the LiteRT benchmark_model tool from litert-cli-nightly 0.2.0.dev20260805: CPU inference (XNNPACK, 4 threads), 3 invocations per file of 10 warm-up plus 50 timed runs (the tool caps a phase at 150 s, so very slow graphs run fewer — the Runs column is the actual timed total). The latency is the median across invocations; the spread is the min–max over all timed runs. No thermal throttling occurred during these runs (vcgencmd get_throttled stayed 0x0).
File
Inference (median)
Spread (min–max)
Runs
Peak memory
pose_256.tflite
75.5 ms
75.2–91.6 ms
150
138 MB
pose_256_fp16.tflite
75.9 ms
75.5–79.9 ms
150
138 MB
License & attribution
License: Apache-2.0. Weights/model from
Daniil-Osokin/lightweight-human-pose-estimation.pytorch.
Based on "Real-time 2D Multi-Person Pose Estimation on CPU: Lightweight OpenPose" (Osokin,
2018). Format conversion only; all credit to the original authors.