Models · Pose estimation

MediaPipe Hand Landmarker

MediaPipe Hand Landmarker (Google, hand_landmarker.task): finds hands and places 21 landmarks on each (wrist and four joints per finger). Palm detector plus a hand-landmark network from the MediaPipe Tasks bundle. Apache-2.0 code and weights.

stable Fork of google-ai-edge/mediapipe@cad7f3a · backends: portable

Checkpoint mediapipe-hand-landmarker

Paper 2020 Added in 0.4.0 Evaluated with 0.4.0

Portable, RTX 5060 Ti 16 GB 3.10 ms 1080x1920, fp16
vs the faster original 9.0× original float16 weights (CPU XNNPACK): 27.8 ms
Peak memory 106 MiB original not measured
Accuracy vs original fp32 −0.38 portable nme, COCO-WholeBody val2017 hands of at least 64 px (13.98 original)

Use it

pip install fastforks

Lean install with only what this model needs: pip install fastforks-core

from fastforks import pose

model = pose.load("mediapipe-hand-landmarker")  # fastest backend that runs here
result = model("photo.jpg", boxes=[[100, 50, 400, 700]])  # person boxes (x0, y0, x1, y1)

# result fields: keypoints, keypoint_scores, boxes, scores
keypoints = result.keypoints  # a torch tensor
arrays = result.numpy()  # the tensor fields as NumPy arrays: arrays["keypoints"]
result.backend  # what ran: mode, device, dtype
Other ways to run it
  • Precision: pose.load("mediapipe-hand-landmarker", dtype="float32") # full precision: slower, portable only
  • Options: pose.load("mediapipe-hand-landmarker", options={"score_threshold": 0.5, "presence_threshold": 0.5})
fastforks bench mediapipe-hand-landmarker

Times the model on this machine. load(…, mode="portable") or mode="kernels" picks a backend; usage guide.

Speed and memory

Every backend on one GPU (RTX 5060 Ti 16 GB) and the same input, the authors’ code included. Portable runs fp16 on CUDA.

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32fp32not measured ––––
Original (own default)CPU run on all 16 cores of the host (the GPU is unused): memory columns are the process peak RSS above the idle process, not GPU memoryfloat16 weights (CPU XNNPACK) 27.8––0.00.03
Portable fp32fp32not measured ––––
Portablefp16 3.109.0×106 MiB/180 MiB0.40.00
Kernelsnot measured ––––
Portable + torch.compilenot measured here ––––
TensorRTnot measured here ––––

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-28. Median of 10 after 3 warm-up, uint8 CUDA image, detector + landmark net per call (CUDA graphs), peak = max over the timed calls. Ratios divide two times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. torch.compile and TensorRT: build time instead of load time. TensorRT memory (engine, not comparable) is the GPU memory the engine took, read from the driver because TensorRT allocates outside PyTorch, so it can't be compared with the PyTorch peaks of the other rows.

Other devices

Not measured on other devices yet.

Licence and weights

Commercial use allowed

Code
Apache-2.0 LICENSE
Weights
Apache-2.0 source
Training data
Google's own training images (about 30k real-world photos annotated with 21 landmarks plus synthetic hand renders; model card); not a public dataset

Our reading of the licences, not legal advice.

Weights

hand_landmarker.task 7.8 MB· hosted on Google Drive

fastforks downloads and checks these files on first use (fastforks download mediapipe-hand-landmarker).

Accuracy

The test set through the authors’ code and through ours: same checkpoint, same protocol. The distance between the original’s fp32 and fp16 runs is what half precision alone costs; our runs should stay within it.

COCO-WholeBody val2017 hands of at least 64 px

whole image in, error / box size %, keypoints within 10 % %, hands found %

Rundtypenme ↑pck10 ↑found ↑Δ nme vs fp32 originalhandsms / hand
Original fp32float16 weights13.9863.365.9 reference 531 23.0
Original fp16not measured
Portable fp32fp3213.5963.566.5 −0.38 531 4.32
Portablefp1613.6063.466.5 −0.38 531 3.38
Kernelsnot measured

Original = the authors’ code, same checkpoint and protocol. Measured on original fp32: CPU (XNNPACK), torch null, 2026-11-30; portable fp32, portable: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7c774f5fe, 2026-11-30.

Closeness to the original

Beyond the test-set scores: the raw output of ours against the original’s fp32 output on the same input, pixel by pixel. CPU, float32: max |diff| <= 0.2 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.08 and p99 <= 0.3 (absolute error of the output keypoints).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.2 not recorded
GPU default dtypes, mean |diff|≤ 0.08 not recorded
GPU default dtypes, p99 |diff|≤ 0.3 not recorded

No GPU comparison recorded for mediapipe-hand-landmarker.

Details

MediaPipe Hand Landmarker (Google, `hand_landmarker.task`): the two-stage hand tracker of the MediaPipe Tasks API. The palm detector (192 x 192 input, SSD anchors on the stride 8 / 16 maps, weighted NMS) finds palms with seven keypoints; each palm is cropped 2.6x its longer side, shifted towards the fingers and rotated by the wrist-to-middle-finger direction; the landmark network (224 x 224 crop) returns 21 hand landmarks and a hand-presence score. The portable runner reads the bundle's two TFLite graphs and runs them as plain torch operators (no TFLite runtime, ONNX-exportable `module()`); detection, rotated crops and projection follow the Tasks graphs. Landmarks are returned in input pixels (x, y; the relative depth, world landmarks and handedness are not part of this port).

Input / output
Input: one RGB image and a box per person. Output: keypoints with confidence scores for every person.
Input size
any H x W >= 32, padded to a multiple of 32; tested up to 3000x4000 (422 MiB allocated)
Options
  • score_threshold=0.50.0 to 1.0· changes the output
  • presence_threshold=0.50.0 to 1.0· changes the output
Outputs
keypoints, keypoint_scores, boxes, scores
CUDA kernels
none: Not needed: two small depthwise-separable graphs (192 px palm detector, 224 px landmark net) run as CUDA graphs in the portable path. RTX 5060 Ti, 960 x 640 image with two hands: 5.5 ms per call, of which the palm net is 0.7 ms and the landmark net 0.7 ms for both hands; the rest is host-side pre- and post-processing. To be 10 % faster, a kernel build would need to cut the network time by about 40 %, and its kernels already take 1 to 10 us each.

Limitations

  • module() is the landmark network on crops (landmarks in crop pixels and the presence probability); detection, crops and projection stay outside the exported graph.
  • x, y only: the relative z, the metric world landmarks and the left / right handedness of the Tasks API are not returned.
  • One image per call (batch 1) and no tracking: every call runs the palm detector (the Tasks VIDEO mode reuses the previous frame's hands).
Full reference, generated from the repository

MediaPipe Hand Landmarker (Google, hand_landmarker.task): finds hands and places 21 landmarks on each (wrist and four joints per finger). Palm detector plus a hand-landmark network from the MediaPipe Tasks bundle. Apache-2.0 code and weights.

Commercial use: yes.

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
mediapipe-hand-landmarkerhand photo (mediapipe-assets woman_hands.jpg (1080x1920)original
portable
kernels
27.8
3.10
no kernels
–
106 / 180
no kernels
mediapipe-hand-landmarkerhand photo (mediapipe-assets woman_hands.jpg (640x960)original
portable
kernels
portable + torch.compile
TensorRT fp16
28.4
3.07
no kernels
1.18
fails: unsupported: torch.export of the generic tflite executor fai
–
107 / 156
no kernels
50 / 134
–
Details
  • Original code: https://github.com/google-ai-edge/mediapipe at cad7f3ab99eb
  • Code licence: Apache-2.0 (permissive); files: LICENSE
  • Weights licence: Apache-2.0
  • Licence evidence: https://github.com/google-ai-edge/mediapipe/blob/cad7f3ab99ebf175947e40c5252c642612aae927/LICENSE
  • Training data: Google's own training images (about 30k real-world photos annotated with 21 landmarks plus synthetic hand renders; model card); not a public dataset
  • Options: score_threshold = 0.5 (0.0 to 1.0), presence_threshold = 0.5 (0.0 to 1.0)
  • Kernel libraries: none (Not needed: two small depthwise-separable graphs (192 px palm detector, 224 px landmark net) run as CUDA graphs in the portable path. RTX 5060 Ti, 960 x 640 image with two hands: 5.5 ms per call, of which the palm net is 0.7 ms and the landmark net 0.7 ms for both hands; the rest is host-side pre- and post-processing. To be 10 % faster, a kernel build would need to cut the network time by about 40 %, and its kernels already take 1 to 10 us each.)
  • Variants: mediapipe-hand-landmarker
  • Outputs: keypoints, keypoint_scores, boxes, scores; label_set: coco-wholebody-hand-21
  • Input size: any H x W >= 32, padded to a multiple of 32
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): mediapipe-hand-landmarker 3000x4000 (0.4 GiB peak allocated, 0.4 reserved)
  • no kernels: Not needed: two small depthwise-separable graphs (192 px palm detector, 224 px landmark net) run as CUDA graphs in the portable path. RTX 5060 Ti, 960 x 640 image with two hands: 5.5 ms per call, of which the palm net is 0.7 ms and the landmark net 0.7 ms for both hands; the rest is host-side pre- and post-processing. To be 10 % faster, a kernel build would need to cut the network time by about 40 %, and its kernels already take 1 to 10 us each.
  • mediapipe-hand-landmarker 640x960, first call: portable + torch.compile 9 s (cold Inductor cache).
  • mediapipe-hand-landmarker original 1080x1920, original 640x960: CPU run on all 16 cores of the host (the GPU is unused): memory columns are the process peak RSS above the idle process, not GPU memory
  • mediapipe-hand-landmarker load / first call: original 0.04 s / 0.028 s, portable 0.43 s / 0.003 s
  • Protocol, median of 10 after 3 warm-up, uint8 CUDA image, detector + landmark net per call (CUDA graphs), peak = max over the timed calls

Measured

Original = the original code named under Details, same checkpoint and protocol.

variantdatasetoriginal fp32portableportable fp32note
mediapipe-hand-landmarkerCOCO-WholeBody val2017 hands of at least 64 px, whole image in, error / box size %, keypoints within 10 % %, hands found %13.98 / 63.3 / 65.913.60 / 63.4 / 66.513.59 / 63.5 / 66.5

Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 7c774f5fe, 2026-11-30.

Parity

CPU, float32: max |diff| <= 0.2 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.08 and p99 <= 0.3 (absolute error of the output keypoints).

variantkernels error vs original, mean / p99GPU, torchkernels used
mediapipe-hand-landmarkerno kernels backend--

Limitations

  • module() is the landmark network on crops (landmarks in crop pixels and the presence probability); detection, crops and projection stay outside the exported graph.
  • x, y only: the relative z, the metric world landmarks and the left / right handedness of the Tasks API are not returned.
  • One image per call (batch 1) and no tracking: every call runs the palm detector (the Tasks VIDEO mode reuses the previous frame's hands).

Example output

No example rendered for this checkpoint yet.