Models · Pose estimation

Sapiens2 pose

Meta's Sapiens2 (2026): top-down 2D human pose with 308 keypoints (body, feet, hands and a dense face) from person boxes. Custom Sapiens2 licence with use restrictions (commercial use allowed, not in the commercial pack).

experimental Fork of facebookresearch/sapiens2@7e5bae8 · backends: portable, kernels

  • Paper Sapiens2 ICLR 2026 · first released 24 Apr 2026
Checkpoint

Paper 2026 Added in 0.4.0 Evaluated with 0.4.0

Kernels, RTX 5060 Ti 16 GB 107 ms 335x500, fp16
vs the faster original 2.8× original bf16: 294 ms
Peak memory 1,029 MiB original: 2,754 MiB
Accuracy vs original fp32 – original not run on the test set

Use it

pip install fastforks

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

from fastforks import pose

model = pose.load("sapiens2-pose-0.4b")  # 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
  • Backend: pose.load("sapiens2-pose-0.4b", mode="kernels") # or "portable", "auto" (default)
  • Precision: pose.load("sapiens2-pose-0.4b", dtype="float32") # full precision: slower, portable only
  • Options: pose.load("sapiens2-pose-0.4b", options={"flip_test": False})
fastforks bench sapiens2-pose-0.4b

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. Kernels runs fp16. Portable runs fp16 on CUDA.

Input: Mixed scenes, 335x500

BackenddtypeTime per call (ms)vs original fp16Peak memory
allocated / reserved
Load (s)First call (s)
Original fp32facebookresearch/sapiens2@7e5bae88456a config model (MODELS.build), fp32, TF32 offfp32 6900.43×2,014 MiB/2,436 MiB3.5–
Original (own default)facebookresearch/sapiens2@7e5bae88456a config model (MODELS.build) under torch.autocast bfloat16 (no authors' flag)bf16 294–2,754 MiB/2,930 MiB3.5–
Portable fp32fp32not measured ––––
Portablefp16 1272.3×1,093 MiB/1,324 MiB0.40.47
Kernelsfp16 1072.8×1,029 MiB/1,160 MiB0.50.44
Portable + torch.compile 3140.94×1,393 MiB/1,582 MiB34 (build)–
TensorRT fp16network on person crops onlyfp16 1971.5×1,588 MiBenginenot comparable65 (build)–

Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-28 to 2026-12-02. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5; one person box (COCO GT), 1024x768 crop; float CUDA image in, crop + network + decode on the GPU; same input as the portable row. 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

DeviceBackenddtypems / callPeak memoryLoad / first call (s)Output vs referenceInput
Apple silicon runs on macOS
Apple M1 Pro 16 GB (MLX, fp16) MLX, torch 2.14.1, 2026-11-30Portablefp166981 2,987 MiB process9.4 / 6.9skip335x500
Portablefp3211596 4,203 MiB process10.1 / 6.7skip335x500

CUDA memory is torch’s peak allocated / reserved; Apple has no such counter, so the Mac rows show the process footprint (weights, Python and torch included). “Output vs reference” compares the device’s output with the stored golden output under the card’s tolerance; – = not checked on that device. Kernels “not implemented” = no kernels for this model on that backend yet: it runs portable there.

Licence and weights

Commercial use unclear

Code
LicenseRef-Sapiens2-License LICENSE
Weights
other source
Training data
Pretraining on Humans-1B (Meta-internal, not released); pose fine-tuning on Shutterstock, Goliath and 3PO keypoint annotations (Meta, not released).
  • weights: other
  • Sapiens2 License (custom, Meta): commercial use allowed, but with use restrictions (no surveillance, biometric identification, deepfakes, inferring sensitive attributes, military use); redistribution must include the licence. https://github.com/facebookresearch/sapiens2/blob/main/LICENSE.md

Our reading of the licences, not legal advice.

Weights

sapiens2_0.4b_pose.safetensors 1.7 GB· hosted on Hugging Face

fastforks downloads and checks these files on first use (fastforks download sapiens2-pose-0.4b).

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 val2017

every 10th image, GT person boxes, keypoint AP

Rundtypekeypoint AP ↑imagesms / image
Original fp32not measured
Original fp16not measured
Portable fp32fp3280.3 500 937
Portablefp1680.3 500 249
Kernelsnot measured

The original code was not run on this dataset, so the table cannot show the distance to it.

Top-down on the same every-tenth-image subset for all modes, ground-truth person boxes, no flip test; people ranked by the mean of their first 17 keypoint scores; pycocotools OKS AP on COCO body joints. Measured on RTX 5060 Ti, torch 2.14.1+cu130, fastforks c0606f892, 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.006 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.05 and p99 <= 0.25 (absolute error of the output keypoints).

CheckToleranceMeasured
CPU fp32, max |diff|≤ 0.006 not recorded
cpu_outliers≤ 0.03 not recorded
GPU default dtypes, mean |diff|≤ 0.05 1.71769
GPU default dtypes, p99 |diff|≤ 0.25 0.14503
gpu_min_score≤ 0.3 not recorded

Recorded for sapiens2-pose-0.4b on RTX 5060 Ti, torch 2.14.1+cu130, 2026-12-02, with these kernels: sapiens2_opsswiglu

Details

Sapiens2 (Meta 2026) top-down 2D human pose with 308 keypoints (body, feet, 2 x 21 hand joints, 238 face points incl. eyes, lips and teeth): a ViT with RoPE, grouped-query attention and SwiGLU, pretrained on 1 B human images, fine-tuned with a deconvolution heatmap head on Shutterstock and Goliath; 1024 x 768 person crops, heatmaps at 256 x 192 decoded with DARK-UDP. Takes person boxes (e.g. from `fastforks.detection`). The portable `module()` maps crops to heatmaps.

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 (2,679 MiB allocated)
Options
  • flip_test=false· changes the output
Outputs
keypoints, keypoint_scores, boxes, scores
Checkpoint
embed_dim=1024, depth=24, num_heads=16, deconv=[1024,768], convs=[512,512,256]
CUDA kernels
  • sapiens2_ops
  • swiglu

Limitations

  • Custom licence with use restrictions: not in the commercial selection (FASTFORKS_COMMERCIAL_ONLY, commercial ComfyUI pack).
  • Large crops (1024 x 768) and 308 heatmaps per person: about 1 GB of activations per batch of 8 people in fp16.
  • fp16 CUDA kernels (shared with Sapiens2 segmentation). Apple MLX: a hand-written network (shared Sapiens2 backbone, channels-last head); the crops and the decoding stay on torch.
Full reference, generated from the repository

Meta's Sapiens2 (2026): top-down 2D human pose with 308 keypoints (body, feet, hands and a dense face) from person boxes. Custom Sapiens2 licence with use restrictions (commercial use allowed, not in the commercial pack).

Commercial use: unclear (treat as no) (weights: other).

variantinputbackendtime (ms)peak memory (MiB, allocated / reserved)
sapiens2-pose-0.4bCOCO val2017 000000013291.jpg (335x500)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
690
294
127
107
314
197 (network on person crops only)
2014 / 2436
2754 / 2930
1093 / 1324
1029 / 1160
1393 / 1582
2635 / 2688
sapiens2-pose-1bCOCO val2017 000000013291.jpg (335x500)original (fp32)
original
portable
kernels
portable + torch.compile
TensorRT fp16
1749
556
350
302
915
565 (network on person crops only)
6337 / 6898
9093 / 9696
3228 / 3508
3123 / 3206
3905 / 3968
7026 / 7078
Details
  • Original code: https://github.com/facebookresearch/sapiens2 at 7e5bae88456a
  • Code licence: LicenseRef-Sapiens2-License (permissive); files: LICENSE
  • Weights licence: other
  • Licence evidence: https://huggingface.co/facebook/sapiens2-pose-0.4b/blob/73572e121602e8a6eb40eb841732e88f386d250b/README.md (license: other, license_name: sapiens2-license) ; https://github.com/facebookresearch/sapiens2/blob/7e5bae88456ac418ff0e58e74106c9fe192055d4/LICENSE.md
  • Training data: Pretraining on Humans-1B (Meta-internal, not released); pose fine-tuning on Shutterstock, Goliath and 3PO keypoint annotations (Meta, not released).
  • Licence note: Sapiens2 License (custom, Meta): commercial use allowed, but with use restrictions (no surveillance, biometric identification, deepfakes, inferring sensitive attributes, military use); redistribution must include the licence. https://github.com/facebookresearch/sapiens2/blob/main/LICENSE.md
  • Options: flip_test = False
  • Kernel libraries: sapiens2_ops, swiglu
  • Variants: sapiens2-pose-0.4b, sapiens2-pose-1b
  • Outputs: keypoints, keypoint_scores, boxes, scores; label_set: goliath-308
  • Input size: any H x W >= 32, padded to a multiple of 32
  • Tested up to (portable, fp16, RTX 5060 Ti 16 GB): sapiens2-pose-0.4b 3000x4000 (2.6 GiB peak allocated, 4.5 reserved); sapiens2-pose-1b 3000x4000 (5.2 GiB peak allocated, 7.3 reserved)
  • sapiens2-pose-0.4b 335x500, first call: portable + torch.compile 34 s (cold Inductor cache), TensorRT fp16 65 s (ONNX + engine).
  • sapiens2-pose-1b 335x500, first call: portable + torch.compile 50 s (cold Inductor cache), TensorRT fp16 128 s (ONNX + engine).
  • sapiens2-pose-0.4b original (fp32) 335x500: facebookresearch/sapiens2@7e5bae88456a config model (MODELS.build), fp32, TF32 off
  • sapiens2-pose-0.4b original 335x500: facebookresearch/sapiens2@7e5bae88456a config model (MODELS.build) under torch.autocast bfloat16 (no authors' flag)
  • sapiens2-pose-1b original (fp32) 335x500: facebookresearch/sapiens2@7e5bae88456a config model (MODELS.build), fp32, TF32 off
  • sapiens2-pose-1b original 335x500: facebookresearch/sapiens2@7e5bae88456a config model (MODELS.build) under torch.autocast bfloat16 (no authors' flag)
  • sapiens2-pose-0.4b load / first call: portable 0.36 s / 0.474 s (335x500), kernels 0.47 s / 0.443 s (335x500)
  • sapiens2-pose-1b load / first call: portable 1.31 s / 0.557 s (335x500), kernels 1.07 s / 0.302 s (335x500)
  • Protocol, median of 20 after 3 warm-ups, one person box (COCO GT), 1024x768 crop; upstream: vis_pose.py process_one_image (config test_pipeline crop + data_preprocessor on the host, network on the GPU, UDPHeatmap decode on the host), all in the timed call; fastforks: float CUDA image in, crop + network + decode on the GPU; peak = one call after the warm-ups (weights included); load / first call: per process

Measured

Top-down on the same every-tenth-image subset for all modes, ground-truth person boxes, no flip test; people ranked by the mean of their first 17 keypoint scores; pycocotools OKS AP on COCO body joints. Original = the original code named under Details, same checkpoint and protocol.

variantdatasetportableportable fp32note
sapiens2-pose-0.4bCOCO val2017, every 10th image, GT person boxes, keypoint AP80.380.3
sapiens2-pose-1bCOCO val2017, every 10th image, GT person boxes, keypoint AP81.081.0

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

Parity

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

variantkernels error vs original, mean / p99GPU, torchkernels used
sapiens2-pose-0.4b1.71769 / 0.14503RTX 5060 Ti, torch 2.14.1+cu130sapiens2_ops@20cfca7e340c:sm_120, swiglu@25fe34a2d389:sm_120
sapiens2-pose-1b0.0207 / 0.07134RTX 5060 Ti, torch 2.14.1+cu130sapiens2_ops@20cfca7e340c:sm_120, swiglu@25fe34a2d389:sm_120

Limitations

  • Custom licence with use restrictions: not in the commercial selection (FASTFORKS_COMMERCIAL_ONLY, commercial ComfyUI pack).
  • Large crops (1024 x 768) and 308 heatmaps per person: about 1 GB of activations per batch of 8 people in fp16.
  • fp16 CUDA kernels (shared with Sapiens2 segmentation). Apple MLX: a hand-written network (shared Sapiens2 backbone, channels-last head); the crops and the decoding stay on torch.

Example output

No example rendered for this checkpoint yet.