mmpose icon indicating copy to clipboard operation
mmpose copied to clipboard

[Feature] How to convert the RTMPose3D model to onnx

Open 6667777 opened this issue 1 year ago • 5 comments

What is the feature?

I wanted to convert the RTMPose3D model to onnx, but there was no tutorial to do so. I also tried to convert the RTMPose3D model in the same way as converting RTMPose, but failed

Any other context?

No response

6667777 avatar Sep 18 '24 02:09 6667777

any update?

chopin1998 avatar Sep 30 '24 07:09 chopin1998

import torch from mmpose.apis import init_model pose_estimator = init_model( './configs/rtmw3d-l_8xb64_cocktail14-384x288.py', 'rtmw3d-l_8xb64_cocktail14-384x288-794dbc78_20240626.pth', device='cpu')

input = torch.randn(1, 3, 384, 288) data_samples = {}

torch.onnx.export( pose_estimator, (input, data_samples), "model.onnx", input_names=["input"], output_names=["output"], verbose=True
)

yangl720 avatar Oct 12 '24 05:10 yangl720

import torch from mmpose.apis import init_model pose_estimator = init_model( './configs/rtmw3d-l_8xb64_cocktail14-384x288.py', 'rtmw3d-l_8xb64_cocktail14-384x288-794dbc78_20240626.pth', device='cpu')

input = torch.randn(1, 3, 384, 288) data_samples = {}

torch.onnx.export( pose_estimator, (input, data_samples), "model.onnx", input_names=["input"], output_names=["output"], verbose=True )

do you have demo code on pre/post-processing ?

chopin1998 avatar Oct 25 '24 01:10 chopin1998

I believe this doesn’t convert the model totally correctly. I converted the model using the script but the output is not close the original model’s.

toprakfirat avatar Feb 08 '25 19:02 toprakfirat

Hello, Are there any updates on this issue, we are very interested in using Rtmpose3D the same way we are using Rtmpose2D with mmdeploy and tensorrt backend. Is there a way to using the deploy.py script from mmdeploy to convert the model to be used directly with mmdeploy API ?

Thank you very much, Maxime

MaximeSabbah avatar Mar 12 '25 10:03 MaximeSabbah

Hello, Are there any updates on this issue, we are very interested in using Rtmpose3D the same way we are using Rtmpose2D with mmdeploy and tensorrt backend. Is there a way to using the deploy.py script from mmdeploy to convert the model to be used directly with mmdeploy API ?

Thank you very much, Maxime

HI, I meet the same problem,and do you solve this problem to convert rtmpose3D to tensorRT? Thank you very much

zszz3 avatar Oct 07 '25 13:10 zszz3