--- license: apache-2.0 tags: - executorch - xnnpack - pte - on-device - keypoint-detection - pose-estimation --- # rtmpose_m_hand — ExecuTorch - **Source**: open-mmlab/mmpose RTMPose (rtmpose-m_simcc-hand5_pt-aic-coco_210e-256x256-74fb594) - **License**: Apache-2.0 - **Input**: [[1, 3, 256, 256]] — RGB, ImageNet norm, 256x256 crop around a hand (detect first, then crop and resize to this aspect) - **Output**: SimCC pair: x [1,21,512] and y [1,21,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. ## Variants All variants take and return fp32 tensors — swap the `.pte` file, keep your app code. | build | file | size (MB) | parity vs fp32 eager (worst corr) | Mac median (ms)* | |-----------|------|-----------|------------------------------------|------------------| | fp32 | `rtmpose_m_hand_xnnpack_fp32.pte` | 55.1 | 1.000000 | 9.5 | | Core ML (fp16, iOS) | `rtmpose_m_hand_coreml_all.pte` | 28.0 | 0.999768 | 2.9 | The Core ML build is the same graph lowered to Apple's Neural Engine instead of XNNPACK, which is CPU-only. Measured on an iPhone 17 Pro across seven models, it runs **3.5x to 13.9x faster (median 12x)** at roughly half the file size — for example Depth-Anything-V2-Small at 500.8 ms against 42.7 ms, and MODNet at 81.7 ms against 5.9 ms. It computes in fp16 and is iOS-only; the XNNPACK files stay the portable option and are what runs on Android. \*Mac arm64, single process, median of 10 — a reference point for relative cost only, not a device number (torch eager fp32 on the same machine: 90.7 ms). ### Checked in the task's own units Correlation is a first filter. These are the numbers that decide: - **Core ML (fp16, iOS)** — measured in the units that matter for this model — fraction of keypoints landing within 4 px of fp32: median 1.0000 over 8 real images, worst 1.0000. ## Verification (executorch 1.4.0, torch 2.13.0) Parity is measured against the fp32 eager model on real image input; `corr` is the correlation over all elements of each output tensor. | output | shape | max_abs_diff | corr | |--------|-------|--------------|------| | 0 | [1, 21, 512] | 3.867e-06 | 1.000000 | | 1 | [1, 21, 512] | 4.172e-06 | 1.000000 | XNNPACK delegate coverage (fp32): 93.9% (306/326 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 ## Conversion torch.export -> to_edge_transform_and_lower(partitioner) -> .pte (conversion scripts: [executorch-models](https://github.com/john-rocky/executorch-models))