rtmo-s-coco / README.md
vccarvalho11's picture
Upload rtmo-s-coco ONNX model
b7486eb verified
|
Raw History Blame Contribute Delete
4.24 kB
---
library_name: onnx
tags:
- rtmo
- mmpose
- pose-estimation
- keypoint-detection
- coco
- apache-2.0
- onnx
- inference4j
license: apache-2.0
pipeline_tag: keypoint-detection
datasets:
- coco
---
# RTMO-S (COCO, 640) — ONNX
[RTMO-S](https://github.com/open-mmlab/mmpose/tree/main/projects/rtmo), a one-stage real-time multi-person pose estimator from MMPose, trained on COCO only. One run returns every person's box and 17 body keypoints. Apache-2.0 code and weights, exported to ONNX with MMDeploy.
Exported for use with [inference4j](https://github.com/inference4j/inference4j), an inference-only AI library for Java.
## Original Source
- **Repository:** [OpenMMLab (MMPose)](https://github.com/open-mmlab/mmpose/tree/main/projects/rtmo)
- **License:** apache-2.0
## Usage with inference4j
```java
try (PoseDetector detector = RtmoPoseDetector.s().build()) {
List<Pose> poses = detector.detect(Path.of("people.jpg"));
poses.forEach(p -> System.out.printf("person %.2f, left wrist at %s%n",
p.person().confidence(), p.keypoint(CocoJoint.LEFT_WRIST)));
}
```
## Model Details
| Property | Value |
|----------|-------|
| Architecture | RTMO-S (CSPDarknet + hybrid encoder, dynamic coordinate classifier), 9.9M parameters |
| Task | Multi-person 2D pose estimation, 17 COCO keypoints |
| COCO AP | 67.7 (val2017, 640x640, single pass with MMPose's centred letterbox, as reported by the RTMO authors) |
| Input | `input`: `[batch, 3, 640, 640]` float32 (batch dynamic) |
| Pre-processing | Letterbox to the top-left corner: `r = min(640 / h, 640 / w)`, bilinear resize to `(int(w * r), int(h * r))`, pad right and bottom with 114. Raw 0-255 **BGR**, no mean/std, NCHW float32 |
| Output | `dets`: `[batch, N, 5]` = `x1, y1, x2, y2, score` per person; `keypoints`: `[batch, N, 17, 3]` = `x, y, score` per COCO-17 joint. Coordinates in 640 x 640 input pixels, rows sorted by score |
| Post-processing | NMS is in the graph (score > 0.1, class-agnostic IoU 0.65, at most 50 people). When fewer than 50 people are found, the graph appends one padding row with score 0 (box and keypoint scores), so keep rows with score > 0.1. Divide coordinates by `r` and clamp boxes to the image |
| Keypoint order | COCO-17: nose, left_eye, right_eye, left_ear, right_ear, left_shoulder, right_shoulder, left_elbow, right_elbow, left_wrist, right_wrist, left_hip, right_hip, left_knee, right_knee, left_ankle, right_ankle |
| ONNX opset | 11 |
## License
Code and weights: [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), from [MMPose](https://github.com/open-mmlab/mmpose) by OpenMMLab (Lu et al., *RTMO: Towards High-Performance One-Stage Real-Time Multi-Person Pose Estimation*, arXiv:2312.07526, 2023). Training data: COCO (annotations CC BY 4.0; images remain under their Flickr terms).
## Provenance
| Part | Origin |
|------|--------|
| Code | [open-mmlab/mmpose](https://github.com/open-mmlab/mmpose) 1.3.2 (RTMO project), Apache-2.0 |
| Weights | [rtmo-s_8xb32-600e_coco-640x640-8db55a59_20231211.pth](https://download.openmmlab.com/mmpose/v1/projects/rtmo/rtmo-s_8xb32-600e_coco-640x640-8db55a59_20231211.pth) from the [RTMO model zoo](https://github.com/open-mmlab/mmpose/tree/main/projects/rtmo), config [rtmo-s_8xb32-600e_coco-640x640.py](https://github.com/open-mmlab/mmpose/blob/v1.3.2/configs/body_2d_keypoint/rtmo/coco/rtmo-s_8xb32-600e_coco-640x640.py), Apache-2.0 |
| ONNX export | Exported here (no upstream ONNX exists for the COCO-only checkpoints) |
| Training data | COCO 2017 train person keypoints only (annotations CC BY 4.0, images under Flickr terms). The CSPDarknet backbone is initialised from MMDetection's COCO-trained YOLOX-S weights (`yolox_s_8x8_300e_coco_20211121_095711-4592a793.pth`) |
| Changes in this mirror | Exported with MMDeploy 1.3.1 (`pose-detection_rtmo_onnxruntime_dynamic.py`, opset 11) in a pinned environment: PyTorch 2.1.2, MMPose 1.3.2, mmcv 2.1.0, mmengine 0.10.4. Same graph layout as MMPose's official body7 `onnx_sdk` exports, except that the padding row scores 0 instead of repeating the last anchor's prediction. Weights unchanged apart from MMPose's `switch_to_deploy` (the neck's RepVGG blocks fused, anchor grid precomputed) |