HRNet
HRNet (w32, w48; 256x192 and 384x288): top-down 2D human pose with a high-resolution CNN and heatmap decoding, the COCO checkpoints of OpenMMLab's mmpose. Apache-2.0.
stable Fork of open-mmlab/mmpose@5408bc7 · backends: portable, kernels
- Paper Deep High-Resolution Representation Learning for Human Pose Estimation CVPR 2019 · first released 25 Feb 2019
- Authors’ code leoxiaobin/deep-high-resolution-net.pytorch (PyTorch), not the code forked here: The mmpose port loads the model-zoo checkpoints retrained and evaluated in the OpenMMLab pipeline, with its own heatmap codec, instead of the authors' original scripts and weights.
Paper 2019 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("hrnet-w32") # 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 hrnet-w32 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 fp32 | Peak memory allocated / reserved | Load (s) | First call (s) |
|---|---|---|---|---|---|---|
| Original fp32mmpose 1.3.2 inference_topdown (CPU cv2 crop, network, heatmap decode; flip_test off), all in the timed call | fp32 | 176 | – | 270 MiB/324 MiB | 5.4 | 0.46 |
| Original fp16torch.autocast(float16) around the call; mmpose 1.3.2 inference_topdown (CPU cv2 crop, network, heatmap decode; flip_test off), all in the timed call | fp16 | 190 | 0.93× | 336 MiB/398 MiB | 0.5 | 0.38 |
| Portable fp32 | fp32 | not measured | – | – | – | – |
| Portable | fp16 | 20.3 | 8.7× | 195 MiB/238 MiB | 0.5 | 0.36 |
| Kernels | fp16 | 9.75 | 18× | 155 MiB/194 MiB | 1.3 | 0.26 |
| Portable + torch.compile | 9.94 | 18× | 178 MiB/214 MiB | 21 (build) | – | |
| TensorRT fp16network on person crops only | fp16 | 5.18 | 34× | 126 MiBenginenot comparable | 26 (build) | – |
Measured on RTX 5060 Ti 16 GB, torch 2.14.1+cu130, 2026-11-11 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. 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 | 304 | 2,014 MiB process | – | 1080x1920 |
| Portable | fp16 | 122 | 1,675 MiB process | matches | 1080x1920 | |
| Portable | fp32 | 141 | 1,748 MiB process | matches | 1080x1920 | |
| Kernels | fp16 | not implemented | – | 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
hrnet-w32-coco-256x192.pth 122 MB· hosted on OpenMMLabfastforks downloads and checks these files on first use (fastforks download hrnet-w32).
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 | 75.5 | reference | 5000 | – |
| Original fp16 | fp16 | 75.5 | +0.0 | 5000 | – |
| Portable fp32 | not measured | ||||
| Portable | fp16 | 76.5 | +1.0 | 5000 | – |
| Kernels | fp16 | 76.5 | +1.0 | 5000 | – |
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-11; portable, kernels: RTX 5060 Ti, torch 2.14.1+cu130, fastforks 87e1be16, 2026-11-11.
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| <= 4.6e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.32 and p99 <= 4.8 (absolute error of the output keypoints).
| Check | Tolerance | Measured |
|---|---|---|
| CPU fp32, max |diff| | ≤ 0.000046 | not recorded |
| GPU default dtypes, mean |diff| | ≤ 0.32 | 0 |
| GPU default dtypes, p99 |diff| | ≤ 4.8 | 0.00003 |
| gpu_min_score | ≤ 0.3 | not recorded |
Recorded for hrnet-w32 on RTX 5060 Ti, torch 2.14.1+cu130, 2026-11-11, with these kernels: cudnn_haccfvm_convfvm_extrafvm_mbfvm_r3
Details
HRNet (Sun et al. 2019): top-down 2D human pose with a high-resolution CNN that keeps a 1/4-scale branch through the whole network and repeatedly exchanges features with three coarser parallel branches; a 1 x 1 conv on the finest branch gives one heatmap per keypoint, decoded as its maximum moved a quarter heatmap pixel towards the larger neighbour. The mmpose COCO checkpoints (w32 / w48, 256 x 192 and 384 x 288) return the 17 COCO keypoints. Takes person boxes (e.g. from `fastforks.detection`) and crops each at the network size; vendored from mmpose (no mmpose / mmcv dependency). 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 (470 MiB allocated)
- Options
flip_test=false· changes the output
- Outputs
keypoints,keypoint_scores,boxes,scores- CUDA kernels
cudnn_haccconvolutions with fp16 accumulation (cuDNN)fvm_convfused convolutions for image classifiersfvm_extrafused transformer row operations (rotary split, SwiGLU with LayerNorm)fvm_mbfused MBConv blocks (MobileNet and EfficientNet families)fvm_r3further fused classifier blocks
- Apple (MPS)
- fp32, fp16
Full reference, generated from the repository
HRNet (w32, w48; 256x192 and 384x288): top-down 2D human pose with a high-resolution CNN and heatmap decoding, the COCO checkpoints of OpenMMLab's mmpose. Apache-2.0.
Commercial use: yes.
| variant | input | backend | time (ms) | peak memory (MiB, allocated / reserved) |
|---|---|---|---|---|
hrnet-w32 | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 176 190 20.3 9.75 9.94 5.18 (network on person crops only) | 270 / 324 336 / 398 195 / 238 155 / 194 178 / 214 216 / 254 |
hrnet-w32-384 | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 216 190 39.2 19.7 19.6 10.7 (network on person crops only) | 682 / 762 653 / 760 341 / 414 250 / 294 211 / 234 296 / 320 |
hrnet-w48 | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 200 206 32.0 15.6 21.2 9.46 (network on person crops only) | 879 / 1022 440 / 462 262 / 302 222 / 262 245 / 282 346 / 388 |
hrnet-w48-384 | synthetic (1080x1920) | original (fp32) original portable kernels portable + torch.compile TensorRT fp16 | 276 245 70.7 34.2 46.0 22.3 (network on person crops only) | 841 / 928 1014 / 1082 408 / 458 317 / 360 278 / 300 427 / 454 |
Details
- Original code: https://github.com/open-mmlab/mmpose at
5408bc76f5b8 - Code licence: Apache-2.0 (permissive); files:
LICENSE - Weights licence: Apache-2.0
- Licence evidence: https://github.com/open-mmlab/mmpose/blob/5408bc76f5b848cf925a0d1857899011d8c5b497/README.md#license
- Training data: COCO 2017 (train, instance annotations), ImageNet-1k (ILSVRC 2012 classification) (COCO 2017 keypoints; the HRNet backbone was initialised from ImageNet-1k classification weights)
- Options:
flip_test= False - Kernel libraries:
cudnn_hacc,fvm_conv,fvm_extra,fvm_mb,fvm_r3 - Variants:
hrnet-w32,hrnet-w32-384,hrnet-w48,hrnet-w48-384 - 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):
hrnet-w323000x4000 (0.5 GiB peak allocated, 0.5 reserved);hrnet-w32-3843000x4000 (0.7 GiB peak allocated, 0.8 reserved);hrnet-w483000x4000 (0.5 GiB peak allocated, 0.6 reserved);hrnet-w48-3843000x4000 (0.8 GiB peak allocated, 0.9 reserved) hrnet-w321080x1920, first call: portable + torch.compile 21 s (cold Inductor cache), TensorRT fp16 26 s (ONNX + engine).hrnet-w32-3841080x1920, first call: portable + torch.compile 21 s (cold Inductor cache), TensorRT fp16 26 s (ONNX + engine).hrnet-w481080x1920, first call: portable + torch.compile 21 s (cold Inductor cache), TensorRT fp16 27 s (ONNX + engine).hrnet-w48-3841080x1920, first call: portable + torch.compile 23 s (cold Inductor cache), TensorRT fp16 28 s (ONNX + engine).hrnet-w32original (fp32) 1080x1920: mmpose 1.3.2 inference_topdown (CPU cv2 crop, network, heatmap decode; flip_test off), all in the timed callhrnet-w32original 1080x1920: torch.autocast(float16) around the call; mmpose 1.3.2 inference_topdown (CPU cv2 crop, network, heatmap decode; flip_test off), all in the timed callhrnet-w32-384original (fp32) 1080x1920: mmpose 1.3.2 inference_topdown (CPU cv2 crop, network, heatmap decode; flip_test off), all in the timed callhrnet-w32-384original 1080x1920: torch.autocast(float16) around the call; mmpose 1.3.2 inference_topdown (CPU cv2 crop, network, heatmap decode; flip_test off), all in the timed callhrnet-w48original (fp32) 1080x1920: mmpose 1.3.2 inference_topdown (CPU cv2 crop, network, heatmap decode; flip_test off), all in the timed callhrnet-w48original 1080x1920: torch.autocast(float16) around the call; mmpose 1.3.2 inference_topdown (CPU cv2 crop, network, heatmap decode; flip_test off), all in the timed callhrnet-w48-384original (fp32) 1080x1920: mmpose 1.3.2 inference_topdown (CPU cv2 crop, network, heatmap decode; flip_test off), all in the timed callhrnet-w48-384original 1080x1920: torch.autocast(float16) around the call; mmpose 1.3.2 inference_topdown (CPU cv2 crop, network, heatmap decode; flip_test off), all in the timed callhrnet-w32load / first call: original 0.45 s / 0.383 s, portable 0.25 s / 0.564 s, kernels 2.53 s / 0.285 shrnet-w32-384load / first call: original 0.42 s / 0.225 s, portable 0.25 s / 0.567 s, kernels 2.04 s / 0.254 shrnet-w48load / first call: original 0.72 s / 0.225 s, portable 0.72 s / 0.351 s, kernels 1.76 s / 0.199 shrnet-w48-384load / first call: original 0.53 s / 0.242 s, portable 0.39 s / 0.355 s, kernels 2.16 s / 0.212 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 |
|---|---|---|---|---|---|---|
hrnet-w32 | COCO val2017, ground-truth person boxes, keypoint AP | 75.5 | 75.5 | 76.5 | 76.5 | |
hrnet-w32-384 | COCO val2017, ground-truth person boxes, keypoint AP | 76.7 | 76.7 | 77.6 | 77.7 | |
hrnet-w48 | COCO val2017, ground-truth person boxes, keypoint AP | 76.5 | 76.6 | 76.7 | 76.7 | |
hrnet-w48-384 | COCO val2017, ground-truth person boxes, keypoint AP | 77.0 | 77.0 | 77.7 | 77.6 |
Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 87e1be16, 2026-11-11.
Parity
CPU, float32: max |diff| <= 4.6e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.32 and p99 <= 4.8 (absolute error of the output keypoints).
| variant | kernels error vs original, mean / p99 | GPU, torch | kernels used |
|---|---|---|---|
hrnet-w32 | 0.0 / 3e-05 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
hrnet-w32-384 | 0.10128 / 2.15711 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
hrnet-w48 | 0.0 / 3e-05 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c:sm_120 |
hrnet-w48-384 | 0.20784 / 3.15067 | RTX 5060 Ti, torch 2.14.1+cu130 | cudnn_hacc@cudnn92400, fvm_conv@f1d064e539e1:sm_120, fvm_extra@3208ce525a91:sm_120, fvm_mb@720dd3f29bf7:sm_120, fvm_r3@f54eb890e23c: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).