Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Feature] How to convert the RTMPose3D model to onnx #3125

Open
6667777 opened this issue Sep 18, 2024 · 3 comments
Open

[Feature] How to convert the RTMPose3D model to onnx #3125

6667777 opened this issue Sep 18, 2024 · 3 comments

Comments

@6667777
Copy link

6667777 commented Sep 18, 2024

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

@chopin1998
Copy link

any update?

@yangl720
Copy link

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
)

@chopin1998
Copy link

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 ?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants