Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- executorch
|
| 5 |
+
- xnnpack
|
| 6 |
+
- pte
|
| 7 |
+
- on-device
|
| 8 |
+
- keypoint-detection
|
| 9 |
+
- pose-estimation
|
| 10 |
+
---
|
| 11 |
+
# rtmpose_s_body — ExecuTorch XNNPACK
|
| 12 |
+
|
| 13 |
+
- **Source**: open-mmlab/mmpose RTMPose-s body7 (rtmpose-s_simcc-body7_pt-body7_420e-256x192)
|
| 14 |
+
- **License**: Apache-2.0
|
| 15 |
+
- **Input**: [[1, 3, 256, 192]] — RGB, ImageNet norm, 256x192 person crop (detect first, then crop and resize to this aspect)
|
| 16 |
+
- **Output**: SimCC pair: x [1,17,384] and y [1,17,512] — a 1-D distribution per keypoint per axis. Decode: keypoint k sits at (argmax(x[k]) / 2, argmax(y[k]) / 2) in crop pixels; the max value doubles as the confidence.
|
| 17 |
+
|
| 18 |
+
## Variants
|
| 19 |
+
|
| 20 |
+
All variants take and return fp32 tensors — swap the `.pte` file, keep your app code.
|
| 21 |
+
|
| 22 |
+
| precision | file | size (MB) | parity vs fp32 eager (worst corr) | Mac median (ms)* |
|
| 23 |
+
|-----------|------|-----------|------------------------------------|------------------|
|
| 24 |
+
| fp32 | `rtmpose_s_body_xnnpack_fp32.pte` | 21.9 | 1.000000 | 5.7 |
|
| 25 |
+
|
| 26 |
+
\*Mac arm64, single process, median of 10 — a reference point for relative cost
|
| 27 |
+
only, not a device number (torch eager fp32 on the same machine: 34.3 ms).
|
| 28 |
+
|
| 29 |
+
### Precisions that did not earn a slot
|
| 30 |
+
|
| 31 |
+
- **fp16 is not shipped**: keypoints move a median of 16 px and up to 41 px on a 192x256 crop (169 confident keypoints across 12 person crops). It also only saves 5% of the file, so there is nothing to weigh against that.
|
| 32 |
+
- **int8 is not shipped**: keypoints move a median of 131 px on a 192x256 crop — the pose is gone. CSPNeXt's channel attention and the head's gated attention unit both resist post-training quantization; this needs QAT, not a different calibration set (re-calibrating on person crops rather than scenes made it worse, not better).
|
| 33 |
+
|
| 34 |
+
## Verification (executorch 1.4.0, torch 2.13.0)
|
| 35 |
+
|
| 36 |
+
Parity is measured against the fp32 eager model on real image input; `corr` is
|
| 37 |
+
the correlation over all elements of each output tensor.
|
| 38 |
+
|
| 39 |
+
| output | shape | max_abs_diff | corr |
|
| 40 |
+
|--------|-------|--------------|------|
|
| 41 |
+
| 0 | [1, 17, 384] | 6.855e-06 | 1.000000 |
|
| 42 |
+
| 1 | [1, 17, 512] | 8.076e-06 | 1.000000 |
|
| 43 |
+
|
| 44 |
+
XNNPACK delegate coverage (fp32): 92.0% (229/249 ops); ops left on the portable kernels: `dim_order_ops._to_dim_order_copy.default` x8, `aten.unsqueeze_copy.default` x3, `aten.split_with_sizes_copy.default` x3, `aten.sum.dim_IntList` x2, `aten.pow.Tensor_Scalar` x2, `aten.squeeze_copy.dims` x2
|
| 45 |
+
|
| 46 |
+
## Conversion
|
| 47 |
+
|
| 48 |
+
torch.export -> to_edge_transform_and_lower(XnnpackPartitioner) -> .pte
|
| 49 |
+
(conversion scripts: [executorch-models](https://github.com/john-rocky/executorch-models))
|