ViTPose / ViTPose++
ViTPose and ViTPose++ (base, small, large, huge): top-down 2D human pose with a plain vision transformer, from the weights published by the University of Sydney on Hugging Face. Apache-2.0.
stable Fork of huggingface/[email protected] · backends: portable, kernels
- Paper ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation NeurIPS 2022 · first released 26 Apr 2022
- Authors’ code ViTAE-Transformer/ViTPose (PyTorch), not the code forked here: The authors' code is built on mmpose; the Hugging Face transformers port is dependency-light and ships the converted weights.
Paper 2022 Added in 0.2.0 Evaluated with 0.2.0
Use it
pip install fastforks Lean install with only what this model needs: pip install fastforks-core
from fastforks import pose
model = pose.load("vitpose-base-simple") # kernels on a supported GPU, else portable PyTorch
result = model(image, boxes=...)
result.keypoints # also: keypoint_scores, boxes, scores
result.backend # what ran: mode, device, dtype, kernels fastforks bench vitpose-base-simple 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: synthetic, 1080x1920 (the task’s standard size)
| Backend | dtype | Time per call (ms) | vs original fp16 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed call; ≈ 88.1 ms of it CPU crop + decode | fp32 | 145 | 0.75× | 667 MiB/702 MiB | 0.4 | 0.15 |
| Original fp16torch.autocast(fp16) around the call; transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed call; ≈ 88.8 ms of it CPU crop + decode | fp16 | 109 | – | 828 MiB/962 MiB | 0.1 | 0.17 |
| Original fp32, network onlycrop and decode not timed | fp32 | 56.9 | 1.9× | 667 MiB/682 MiB | – | 0.24 |
| Original fp16, network onlycrop and decode not timed | fp16 | 20.3 | 5.4× | 828 MiB/962 MiB | – | 0.38 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| PortableGPU crop 2.48 · network 16.7 · decode + map back 0.883 ms | fp16 | 18.1 | 6.0× | 312 MiB/342 MiB | 0.5 | 0.47 |
| KernelsGPU crop 2.48 · network + decode 11.6 · map back 0.0870 ms | fp16 | 12.1 | 9.0× | 295 MiB/344 MiB | 0.5 | 0.51 |
| Portable + torch.compile | 16.0 | 6.8× | 590 MiB/622 MiB | 12 (build) | – | |
| TensorRT fp16network on person crops only | fp16 | 9.36 | 12× | 268 MiBenginenot comparable | 35 (build) | – |
| TensorRT + our crop and decodeestimate: engine 9.36 + portable GPU crop 2.48 + decode 0.883 ms | fp16 | 12.7 | 8.6× | – | – | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-10 to 2026-11-16. First call, 3 warm-up, peak reset, median of 3 rounds x median of 5. Ratios divide two
times of this table (same GPU, same input). Original fp16 is the authors’ own precision option, else torch.autocast. “Network only” times the original’s network on the same crops, batched as one call; the
original rows above also include its own crop pipeline and decode, as ours do. The splits under Portable and Kernels come from a separate run that times each step on its own
(synchronised in between); the TensorRT engine covers the network only, so its full call is an estimate with
our crop and decode added. 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
| Device | Backend | dtype | ms / call | Peak memory | Output vs reference | Input |
|---|---|---|---|---|---|---|
| Apple M1 Pro 16 GB MPS, torch 2.14.1, 2026-11-12 | Original | fp32 | 254 | 2,270 MiB process | – | 1080x1920 |
| Portable | fp16 | 186 | 1,910 MiB process | matches | 1080x1920 | |
| Portable | fp32 | 196 | 2,073 MiB process | matches | 1080x1920 | |
| Kernels | fp16 | 160 | 1,977 MiB process | matches | 1080x1920 |
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 allowed
- Code
- Apache-2.0 LICENSE
- Weights
- Apache-2.0 source
- Training data
-
- COCO 2017 (train, instance annotations) CC-BY-4.0
- ImageNet-1k (ILSVRC 2012 classification) noncommercial, non-commercial
Our reading of the licences, not legal advice.
Weights
vitpose-base-simple-85375373.safetensors 344 MB· hosted on Hugging Facefastforks downloads and checks these files on first use (fastforks download vitpose-base-simple).
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
ground-truth person boxes, keypoint AP
| Run | dtype | keypoint AP ↑ | Δ keypoint AP vs fp32 original | images | ms / image |
|---|---|---|---|---|---|
| Original fp32 | fp32 | 76.3 | reference | 5000 | – |
| Original fp16 | fp16 | 76.3 | −0.1 | 5000 | – |
| Portable fp32 | not measured | ||||
| Portable | fp16 | 76.3 | −0.1 | 5000 | 5.12 |
| Kernels | fp16 | 76.3 | ±0.0 | 5000 | 4.47 |
Top-down on the ground-truth person boxes (non-crowd, at least one labelled keypoint), no flip test; people ranked by the mean of their 17 keypoint scores (not mmpose's rescoring and OKS-NMS), so not the papers' AP; pycocotools OKS AP; whole-body models scored on their 17 body keypoints. Original = the authors’ code, same checkpoint and protocol. Measured on original fp32, original fp16: RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-13; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 2241b095+unc, 2026-11-09.
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.005 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.13 and p99 <= 0.75 (absolute error of the output keypoints).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.005 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.13 | 0.0403 |
| GPU default dtypes, p99 |diff| | ≤ 0.75 | 0.27042 |
| gpu_min_score | ≤ 0.3 | not recorded |
Recorded for vitpose-base-simple on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-09, with these kernels: fvm_conv
Details
ViTPose (Xu et al. 2022): top-down 2D human pose with a plain ViT encoder and a light deconvolution (or bilinear) decoder; ViTPose++ trains one backbone on six pose datasets with per-dataset MLP experts. Takes person boxes (e.g. from `fastforks.detection`), crops each at 256 x 192 and returns the 17 COCO keypoints with DARK sub-pixel decoding. 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 (4,627 MiB allocated)
- Options
fp32_accumulate=false
- Outputs
keypoints,keypoint_scores,boxes,scores- Checkpoint
decoder="simple"- CUDA kernels
fvm_convfused convolutions for image classifiers
- Apple (MPS)
pose_metalMetal: top-down pose decoders and crops. fp32, fp16
Full reference, generated from the repository
ViTPose and ViTPose++ (base, small, large, huge): top-down 2D human pose with a plain vision transformer, from the weights published by the University of Sydney on Hugging Face. Apache-2.0.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
vitpose-base-simple | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 145 109 18.1 12.1 16.0 9.36 (network on person crops only) | 667 / 702 828 / 962 312 / 342 295 / 344 590 / 622 499 / 550 |
vitpose-base | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 139 105 17.8 12.0 16.4 8.88 (network on person crops only) | 592 / 602 713 / 762 299 / 322 274 / 364 597 / 622 473 / 516 |
vitpose-plus-small | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 120 104 7.83 6.05 7.54 3.39 (network on person crops only) | 298 / 310 312 / 376 164 / 196 145 / 198 472 / 496 214 / 256 |
vitpose-plus-base | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 162 113 17.9 11.9 16.4 8.87 (network on person crops only) | 729 / 742 918 / 1002 299 / 322 274 / 344 597 / 622 473 / 516 |
vitpose-plus-large | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 331 165 53.7 33.2 46.9 29.3 (network on person crops only) | 2111 / 2144 2873 / 3004 1014 / 1062 706 / 764 1014 / 1062 1312 / 1338 |
vitpose-plus-huge | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 610 242 102 62.5 92.9 58.7 (network on person crops only) | 4100 / 4124 5732 / 5846 1382 / 1424 1351 / 1406 1641 / 1682 2595 / 2654 |
Details
- Original code: https://github.com/huggingface/transformers at
v4.57.1 - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: Apache-2.0
- Licence evidence: https://huggingface.co/usyd-community/vitpose-base-simple (model card licence)
- Training data: COCO 2017 (train, instance annotations), ImageNet-1k (ILSVRC 2012 classification) (COCO 2017 keypoints; the ViT was initialised from MAE ImageNet-1k pre-training)
vitpose-plus-small: COCO 2017 (train, instance annotations), AI Challenger human keypoints (2017), MPII Human Pose, AP-10K (animal pose), APT-36K (animal pose tracking), COCO-WholeBody, ImageNet-1k (ILSVRC 2012 classification) (ViTPose++: one backbone trained jointly on COCO, AI Challenger, MPII, AP-10K, APT-36K and COCO-WholeBody (one MLP expert per dataset), from MAE ImageNet-1k pre-training; only the COCO expert and head are used)vitpose-plus-base: COCO 2017 (train, instance annotations), AI Challenger human keypoints (2017), MPII Human Pose, AP-10K (animal pose), APT-36K (animal pose tracking), COCO-WholeBody, ImageNet-1k (ILSVRC 2012 classification) (ViTPose++: one backbone trained jointly on COCO, AI Challenger, MPII, AP-10K, APT-36K and COCO-WholeBody (one MLP expert per dataset), from MAE ImageNet-1k pre-training; only the COCO expert and head are used)vitpose-plus-large: COCO 2017 (train, instance annotations), AI Challenger human keypoints (2017), MPII Human Pose, AP-10K (animal pose), APT-36K (animal pose tracking), COCO-WholeBody, ImageNet-1k (ILSVRC 2012 classification) (ViTPose++: one backbone trained jointly on COCO, AI Challenger, MPII, AP-10K, APT-36K and COCO-WholeBody (one MLP expert per dataset), from MAE ImageNet-1k pre-training; only the COCO expert and head are used)vitpose-plus-huge: COCO 2017 (train, instance annotations), AI Challenger human keypoints (2017), MPII Human Pose, AP-10K (animal pose), APT-36K (animal pose tracking), COCO-WholeBody, ImageNet-1k (ILSVRC 2012 classification) (ViTPose++: one backbone trained jointly on COCO, AI Challenger, MPII, AP-10K, APT-36K and COCO-WholeBody (one MLP expert per dataset), from MAE ImageNet-1k pre-training; only the COCO expert and head are used)
- Options:
fp32_accumulate= False (precision only) - Kernel libraries:
fvm_conv - Variants:
vitpose-base-simple,vitpose-base,vitpose-plus-small,vitpose-plus-base,vitpose-plus-large,vitpose-plus-huge - Outputs: keypoints, keypoint_scores, boxes, scores; label_set:
coco-keypoints-17 - Input size: any H x W >= 32, padded to a multiple of 32
- Tested up to (portable, fp16, RTX 5060 Ti 16 GB):
vitpose-base-simple3000x4000 (4.5 GiB peak allocated, 4.8 reserved);vitpose-base3000x4000 (4.5 GiB peak allocated, 4.8 reserved);vitpose-plus-small3000x4000 (4.4 GiB peak allocated, 4.6 reserved);vitpose-plus-base3000x4000 (4.5 GiB peak allocated, 4.8 reserved);vitpose-plus-large3000x4000 (4.9 GiB peak allocated, 5.2 reserved);vitpose-plus-huge3000x4000 (5.5 GiB peak allocated, 5.7 reserved) vitpose-base-simple1080x1920, first call: portable + torch.compile 12 s (cold Inductor cache), TensorRT fp16 35 s (ONNX + engine).vitpose-base1080x1920, first call: portable + torch.compile 11 s (cold Inductor cache), TensorRT fp16 36 s (ONNX + engine).vitpose-plus-small1080x1920, first call: portable + torch.compile 11 s (cold Inductor cache), TensorRT fp16 38 s (ONNX + engine).vitpose-plus-base1080x1920, first call: portable + torch.compile 11 s (cold Inductor cache), TensorRT fp16 35 s (ONNX + engine).vitpose-plus-large1080x1920, first call: portable + torch.compile 18 s (cold Inductor cache), TensorRT fp16 39 s (ONNX + engine).vitpose-plus-huge1080x1920, first call: portable + torch.compile 21 s (cold Inductor cache), TensorRT fp16 47 s (ONNX + engine).vitpose-base-simpleoriginal (fp32) 1080x1920: transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-base-simpleoriginal 1080x1920: torch.autocast(fp16) around the call; transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-baseoriginal (fp32) 1080x1920: transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-baseoriginal 1080x1920: torch.autocast(fp16) around the call; transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-plus-smalloriginal (fp32) 1080x1920: transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-plus-smalloriginal 1080x1920: torch.autocast(fp16) around the call; transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-plus-baseoriginal (fp32) 1080x1920: transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-plus-baseoriginal 1080x1920: torch.autocast(fp16) around the call; transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-plus-largeoriginal (fp32) 1080x1920: transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-plus-largeoriginal 1080x1920: torch.autocast(fp16) around the call; transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-plus-hugeoriginal (fp32) 1080x1920: transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-plus-hugeoriginal 1080x1920: torch.autocast(fp16) around the call; transformers 4.57.1 VitPoseImageProcessor (CPU crop) + VitPoseForPoseEstimation + post_process_pose_estimation, all in the timed callvitpose-base-simpleload / first call: original 0.15 s / 0.17 s, portable 0.4 s / 0.408 s, kernels 1.04 s / 0.41 svitpose-baseload / first call: original 0.16 s / 0.328 s, portable 0.73 s / 0.369 s, kernels 0.71 s / 0.346 svitpose-plus-smallload / first call: original 0.15 s / 0.119 s, portable 0.81 s / 0.461 s, kernels 1.09 s / 0.503 svitpose-plus-baseload / first call: original 0.19 s / 0.121 s, portable 0.65 s / 0.345 s, kernels 1.1 s / 0.343 svitpose-plus-largeload / first call: original 0.41 s / 0.166 s, portable 1.5 s / 0.412 s, kernels 1.63 s / 0.407 svitpose-plus-hugeload / first call: original 0.65 s / 0.251 s, portable 2.69 s / 0.438 s, kernels 2.26 s / 0.397 s- Protocol, first call, 3 warm-up, peak reset, median of 3 rounds x median of 5
Measured
Top-down on the ground-truth person boxes (non-crowd, at least one labelled keypoint), no flip test; people ranked by the mean of their 17 keypoint scores (not mmpose's rescoring and OKS-NMS), so not the papers' AP; pycocotools OKS AP; whole-body models scored on their 17 body keypoints. Original = the original code named under Details, same checkpoint and protocol.
| variant | dataset | original fp32 | original fp16 | portable | kernels | note |
|---|---|---|---|---|---|---|
vitpose-base-simple | COCO val2017, ground-truth person boxes, keypoint AP | 76.3 | 76.2 | 76.3 | 76.3 | |
vitpose-base | COCO val2017, ground-truth person boxes, keypoint AP | 76.4 | 76.4 | 76.4 | 76.4 | |
vitpose-plus-small | COCO val2017, ground-truth person boxes, keypoint AP | 76.8 | 76.8 | 76.8 | 76.8 | |
vitpose-plus-base | COCO val2017, ground-truth person boxes, keypoint AP | 78.6 | 78.6 | 78.6 | 78.6 | |
vitpose-plus-large | COCO val2017, ground-truth person boxes, keypoint AP | 80.6 | 80.6 | 80.5 | 80.5 | |
vitpose-plus-huge | COCO val2017, ground-truth person boxes, keypoint AP | 81.0 | 81.0 | 80.9 | 80.9 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 2241b095+uncommitted, 2026-11-09.
Parity
CPU, float32: max |diff| <= 0.005 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.13 and p99 <= 0.75 (absolute error of the output keypoints).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
vitpose-base-simple | 0.0403 / 0.27042 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
vitpose-base | 0.02513 / 0.17409 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
vitpose-plus-small | 0.02359 / 0.11659 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
vitpose-plus-base | 0.08143 / 0.49756 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
vitpose-plus-large | 0.02603 / 0.09324 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
vitpose-plus-huge | 0.01678 / 0.09697 | RTX 5060 Ti, torch 2.14.1+cu130 | fvm_conv@f1d064e539e1:sm_120 |
Example output
One fixed input through this checkpoint, the same for every model of the task (kernels · float16 · NVIDIA GeForce RTX 5060 Ti).
Input: Astronaut Eileen Collins, NASA (public domain).