open-mmlab / mmdeploy

OpenMMLab Model Deployment Framework
https://mmdeploy.readthedocs.io/en/latest/
Apache License 2.0
2.71k stars 620 forks source link

Keypoints from converted ONNX model #639

Closed rtaylo45 closed 2 years ago

rtaylo45 commented 2 years ago

Hello,

I have converted a MMPose model into onnx with the following command:

python tools/deploy.py \
configs/mmpose/pose-detection_onnxruntime_static.py \
$MMPOSE_DIR/configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/coco/hrnet_w48_coco_256x192.py \
$CHECKPOINT_DIR/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth \
$MMDEPLOY_DIR/demo/resources/human-pose.jpg --work-dir /content/onnx_models

and i inference the model using onnxruntime. The resulting output is a heatmap with shape (1, 17, 64, 48), is there a special config that i need to add to have the onnx model include the heatmap conversion to the keypoints? If not is there a plugin in MMDeploy that i can use to easily post process the heatmaps to the keypoints?

Thanks, Zack

irexyc commented 2 years ago

A pipeline include data preprocess, model inference and output data postprocess. The onnx/tensorrt model only include the model inference part.

MMDeploy hava already implemented some common preprocess/postprocess. To use there process, you need use mmdeploy sdk c/python api to do the inference.

Generally speaking, you have to do three more things. The answer of this issus describles the work you have to do. For c api demo, you can refer to this. For python api. you can refer to this