Sapiens2 pose (fastforks)
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.
This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: https://github.com/kleinicke/fastforks. Kernels for the kernels backend: https://huggingface.co/fastforks/kernels. Original code: https://github.com/facebookresearch/sapiens2 at 7e5bae88456a.
Author weight repos: https://huggingface.co/facebook/sapiens2-pose-0.4b, https://huggingface.co/facebook/sapiens2-pose-1b.
Task: pose. Tier: experimental. Outputs: keypoints, keypoint_scores, boxes, scores. Backends: portable, kernels.
Input: one RGB image and a box per person. Output: keypoints with confidence scores for every person.
Variants
Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in card.toml.
| variant | weights (author link) | SHA-256 | weights licence | commercial use |
|---|---|---|---|---|
sapiens2-pose-0.4b@1 |
sapiens2_0.4b_pose.safetensors | f1b7b0e5423d |
other | unclear (treat as no) |
sapiens2-pose-1b@1 |
sapiens2_1b_pose.safetensors | 2dab7014a17e |
other | unclear (treat as no) |
Licence
Original-code strings, recorded as they are (research-use package; check them before any other use). Code: LicenseRef-Sapiens2-License. Licence files: LICENSE.
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
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
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)
Speed and memory
Pose, COCO val2017 000000013291.jpg, 335x500
| model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
|---|---|---|---|---|---|---|---|---|---|
sapiens2-pose-0.4b |
690 | 294 | 127 | 107 | 2.8x | 1.2x | 2754 / 2930 | 1093 / 1324 | 1029 / 1160 |
sapiens2-pose-1b |
1749 | 556 | 350 | 302 | 1.8x | 1.2x | 9093 / 9696 | 3228 / 3508 | 3123 / 3206 |
Startup and first call
| model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
|---|---|---|---|---|---|---|
sapiens2-pose-0.4b |
β | 0.36 (335x500) | 0.47 (335x500) | β | 0.47 (335x500) | 0.44 (335x500) |
sapiens2-pose-1b |
β | 1.31 (335x500) | 1.07 (335x500) | β | 0.56 (335x500) | 0.30 (335x500) |
torch.compile and TensorRT
| model | input | time: portable | compile | TensorRT (fp16 unless shown) | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) |
|---|---|---|---|---|---|---|---|---|---|---|---|
sapiens2-pose-0.4b |
335x500 | 127 ms | 314 ms | 197 ms (network on person crops only) | 107 ms | 34.1 s | 65.3 s | 1093 / 1324 | 1393 / 1582 | 1029 / 1160 | 2635 / 2688 |
sapiens2-pose-1b |
335x500 | 350 ms | 915 ms | 565 ms (network on person crops only) | 302 ms | 50.2 s | 128 s | 3228 / 3508 | 3905 / 3968 | 3123 / 3206 | 7026 / 7078 |
Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
Hardware, protocol and caveats: benchmarks (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or (fp32) where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's.
Accuracy
On public datasets
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.
| variant | dataset | portable | portable fp32 | note |
|---|---|---|---|---|
sapiens2-pose-0.4b |
COCO val2017, every 10th image, GT person boxes, keypoint AP | 80.3 | 80.3 | |
sapiens2-pose-1b |
COCO val2017, every 10th image, GT person boxes, keypoint AP | 81.0 | 81.0 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks c0606f892, 2026-11-30.
Parity with the original code
Every variant is checked against reference outputs of the original code at its pinned commit. 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).
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.
Usage
from fastforks import pose
model = pose.load("sapiens2-pose-0.4b") # mode="auto": the preferred backend from recorded measurements
result = model("photo.jpg", boxes=[[x0, y0, x1, y1]]) # one box per person, or a fastforks.detection result
result.keypoints, result.keypoint_scores # [P, K, 2] input pixels, [P, K]
result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
Install with pip install fastforks (see https://github.com/kleinicke/fastforks). Other variants: sapiens2-pose-0.4b, sapiens2-pose-1b.
Kernels backend
pose.load("sapiens2-pose-0.4b", mode="kernels") runs our CUDA kernels (sapiens2_ops, swiglu). It needs a prebuilt kernel for your GPU architecture (downloaded from https://huggingface.co/fastforks/kernels on first use) and a recent NVIDIA driver; if there is none it raises BackendUnavailableError with the reason and never falls back silently. mode="auto" picks kernels when it can run and logs the choice.
Model tree for fastforks/sapiens2-pose
Base model
facebook/sapiens2-pretrain-0.4b