mmpose
mmpose copied to clipboard
[Feature] How to convert the RTMPose3D model to onnx
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
any update?
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
)
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 ?
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.
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
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