Flor commited on
Commit
f8403b4
·
verified ·
1 Parent(s): 0a98c61

card: update from fastforks 1cbf1671

Browse files
Files changed (1) hide show
  1. README.md +127 -0
README.md ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: "fastforks"
3
+ pipeline_tag: "keypoint-detection"
4
+ license: "apache-2.0"
5
+ tags:
6
+ - "pose"
7
+ - "pose-estimation"
8
+ - "human-pose-estimation"
9
+ - "keypoint-detection"
10
+ - "cuda"
11
+ - "pytorch"
12
+ - "fastforks"
13
+ - "fastforks-card"
14
+ ---
15
+ # RTMO (fastforks)
16
+
17
+ RTMO (Lu et al. 2024): real-time one-stage multi-person 2D pose from OpenMMLab. A YOLOX-style CSPDarknet backbone, a hybrid encoder neck (one transformer layer on the coarsest map) and a head that predicts, per grid cell, a person score, a box and a pose vector; a dynamic coordinate classifier turns each kept pose vector into the 17 COCO keypoints over 1D bins that span the person's box. Takes the whole image without person boxes or a separate detector: the backbone runs once per image, while decoding and NMS depend on the detections. The image is letterboxed to 640 x 640 (416 x 416 for `rtmo-t`); vendored from mmpose (no mmpose / mmcv dependency). The portable `module()` maps the letterboxed image to the head's per-cell outputs (decoding and NMS stay outside).
18
+
19
+ 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/open-mmlab/mmpose> at `5408bc76f5b8`.
20
+
21
+ Task: pose. Tier: stable. Outputs: `keypoints`, `keypoint_scores`, `boxes`, `scores`. Backends: `portable`, `kernels`.
22
+
23
+ Input: one RGB image and a box per person. Output: keypoints with confidence scores for every person.
24
+
25
+ ## Variants
26
+
27
+ Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in [`card.toml`](https://github.com/kleinicke/fastforks/blob/main/src/fastforks/pose/models/rtmo/card.toml).
28
+
29
+ | variant | weights (author link) | SHA-256 | weights licence | commercial use |
30
+ |---|---|---|---|---|
31
+ | `rtmo-l@1` | [rtmo-l-body7-640x640.pth](https://download.openmmlab.com/mmpose/v1/projects/rtmo/rtmo-l_16xb16-600e_body7-640x640-b37118ce_20231211.pth) | `b37118cee39b` | Apache-2.0 | yes |
32
+ | `rtmo-m@1` | [rtmo-m-body7-640x640.pth](https://download.openmmlab.com/mmpose/v1/projects/rtmo/rtmo-m_16xb16-600e_body7-640x640-39e78cc4_20231211.pth) | `39e78cc4afed` | Apache-2.0 | yes |
33
+ | `rtmo-s@1` | [rtmo-s-body7-640x640.pth](https://download.openmmlab.com/mmpose/v1/projects/rtmo/rtmo-s_8xb32-600e_body7-640x640-dac2bf74_20231211.pth) | `dac2bf749bbf` | Apache-2.0 | yes |
34
+ | `rtmo-t@1` | [rtmo-t-body7-416x416.pth](https://download.openmmlab.com/mmpose/v1/projects/rtmo/rtmo-t_8xb32-600e_body7-416x416-f48f75cb_20231219.pth) | `f48f75cbd59d` | Apache-2.0 | yes |
35
+
36
+ ## Licence
37
+
38
+ Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. Licence files: `LICENSE`.
39
+
40
+ Training data: COCO 2017 (train, instance annotations), AI Challenger human keypoints (2017), CrowdPose, MPII Human Pose, sub-JHMDB (J-HMDB), Halpe-FullBody, PoseTrack 2018 (body7: COCO, AI Challenger, CrowdPose, MPII, sub-JHMDB, Halpe and PoseTrack18 keypoints; the CSPDarknet backbone starts from a YOLOX COCO detection checkpoint).
41
+
42
+ Licence evidence: <https://github.com/open-mmlab/mmpose/blob/5408bc76f5b848cf925a0d1857899011d8c5b497/README.md#license>
43
+
44
+ ## Input size
45
+
46
+ any H x W >= 32, padded to a multiple of 32
47
+ Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `rtmo-l` 3000x4000 (0.5 GiB peak allocated, 0.6 reserved); `rtmo-m` 3000x4000 (0.5 GiB peak allocated, 0.5 reserved); `rtmo-s` 3000x4000 (0.5 GiB peak allocated, 0.5 reserved); `rtmo-t` 3000x4000 (0.4 GiB peak allocated, 0.5 reserved)
48
+
49
+ ## Speed and memory
50
+
51
+ ### Pose, synthetic, 1080x1920
52
+
53
+ | model | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels |
54
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
55
+ | `rtmo-l` | 17.1 | 21.4 | 10.8 | 8.30 | 2.1x | 1.3x | 800 / 824 | 208 / 226 | 208 / 228 |
56
+ | `rtmo-m` | 14.3 | 17.0 | 8.71 | 6.85 | 2.1x | 1.3x | 422 / 462 | 166 / 190 | 166 / 212 |
57
+ | `rtmo-s` | 11.4 | 15.5 | 7.48 | 6.27 | 1.8x | 1.2x | 228 / 252 | 142 / 160 | 142 / 180 |
58
+ | `rtmo-t` | 11.3 | 13.3 | 7.62 | 6.31 | 1.8x | 1.2x | 118 / 122 | 121 / 136 | 121 / 156 |
59
+
60
+ ### Startup and first call
61
+
62
+ | model | load (s): original | portable | kernels | first call (s): original | portable | kernels |
63
+ | --- | --- | --- | --- | --- | --- | --- |
64
+ | `rtmo-l` | 0.55 | 0.36 | 1.52 | 0.06 | 0.24 | 0.16 |
65
+ | `rtmo-m` | 0.37 | 0.22 | 1.43 | 0.08 | 0.43 | 0.24 |
66
+ | `rtmo-s` | 0.27 | 0.12 | 1.37 | 0.08 | 0.41 | 0.26 |
67
+ | `rtmo-t` | 0.26 | 0.11 | 1.38 | 0.32 | 0.41 | 0.28 |
68
+
69
+ ### torch.compile and TensorRT
70
+
71
+ | model | input | time: portable | compile | TensorRT fp16 | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) |
72
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
73
+ | `rtmo-l` | 1080x1920 | 10.8 ms | 7.07 ms | 2.90 ms (network on person crops only) | 8.30 ms | 18.9 s | 39.6 s | 208 / 226 | 192 / 224 | 208 / 228 | 277 / 306 |
74
+ | `rtmo-m` | 1080x1920 | 8.71 ms | 4.99 ms | 2.03 ms (network on person crops only) | 6.85 ms | 18.0 s | 39.4 s | 166 / 190 | 146 / 170 | 166 / 212 | 194 / 232 |
75
+ | `rtmo-s` | 1080x1920 | 7.48 ms | 3.35 ms | 1.21 ms (network on person crops only) | 6.27 ms | 14.6 s | 36.7 s | 142 / 160 | 121 / 156 | 142 / 180 | 133 / 164 |
76
+ | `rtmo-t` | 1080x1920 | 7.62 ms | 3.30 ms | 0.886 ms (network on person crops only) | 6.31 ms | 15.6 s | 36.8 s | 121 / 136 | 111 / 134 | 121 / 156 | 112 / 150 |
77
+
78
+ Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB).
79
+
80
+ Hardware, protocol and caveats: [benchmarks](https://github.com/kleinicke/fastforks/blob/main/docs/benchmarks.md) (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.
81
+
82
+ ## Accuracy
83
+
84
+ ### On public datasets
85
+
86
+ Bottom-up on all 5,000 validation images, no ground-truth boxes; people ranked by their predicted person score, after model-specific decoding; pycocotools OKS AP. Bottom-up on the same every-tenth-image subset for all modes, ranked by predicted person score after model-specific decoding; pycocotools OKS AP. Original = the original code named under Details, same checkpoint and protocol.
87
+
88
+ | variant | dataset | original fp32 | original fp16 | portable | kernels | note |
89
+ |---|---|---|---|---|---|---|
90
+ | `rtmo-t` | COCO val2017, predicted people, keypoint AP | 57.4 | 57.4 | 57.4 | 57.4 | |
91
+ | `rtmo-t` | COCO val2017, every 10th image, predicted people, keypoint AP | 59.4 | 59.4 | 59.3 | 59.3 | |
92
+ | `rtmo-s` | COCO val2017, predicted people, keypoint AP | 68.6 | 68.6 | 68.5 | 68.5 | |
93
+ | `rtmo-s` | COCO val2017, every 10th image, predicted people, keypoint AP | 71.1 | 71.2 | 71.2 | 71.2 | |
94
+ | `rtmo-m` | COCO val2017, predicted people, keypoint AP | 72.6 | 72.6 | 72.6 | 72.6 | |
95
+ | `rtmo-m` | COCO val2017, every 10th image, predicted people, keypoint AP | 74.2 | 74.2 | 74.2 | 74.2 | |
96
+ | `rtmo-l` | COCO val2017, predicted people, keypoint AP | 74.8 | 74.8 | 74.8 | 74.8 | |
97
+ | `rtmo-l` | COCO val2017, every 10th image, predicted people, keypoint AP | 76.1 | 76.0 | 76.0 | 76.0 | |
98
+
99
+ Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks be54b8b0, 2026-11-11.
100
+
101
+ ### Parity with the original code
102
+
103
+ Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 0.014 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.47 and p99 <= 9.8 (absolute error of the output `keypoints`).
104
+
105
+ ## Limitations
106
+
107
+ - module() exports the letterboxed-image network and raw per-cell head outputs; coordinate decoding and NMS remain outside the exported graph.
108
+ - Float16 and float32 can retain different people near the score threshold.
109
+
110
+ ## Usage
111
+
112
+ ```python
113
+ from fastforks import pose
114
+
115
+ model = pose.load("rtmo-l") # mode="auto": the preferred backend from recorded measurements
116
+ result = model("photo.jpg", boxes=[[x0, y0, x1, y1]]) # one box per person, or a fastforks.detection result
117
+ result.keypoints, result.keypoint_scores # [P, K, 2] input pixels, [P, K]
118
+ result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16')
119
+ ```
120
+
121
+ Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `rtmo-l`, `rtmo-m`, `rtmo-s`, `rtmo-t`.
122
+
123
+ ## Kernels backend
124
+
125
+ `pose.load("rtmo-l", mode="kernels")` runs our CUDA kernels (`cudnn_hacc`, `fvm_conv`, `fvm_extra`, `fvm_mb`, `fvm_r3`). 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.
126
+
127
+ <!-- staged from fastforks 1cbf1671 (2026-11-15) -->