Closed MianMianMeow closed 9 months ago
The preprocessing step in https://github.com/open-mmlab/mmpose/blob/main/projects/rtmpose/examples/onnxruntime/main.py is equivalent to the transform dict(type='GetBBoxCenterScale', padding=1.25)
. However, the padding
factor in your config val_pipeline
is set to a default value 1.0. You can try to modify the factor in the following line to 1.0 and run again
https://github.com/open-mmlab/mmpose/blob/efe09cd5268d4d6b21100334fbf2947ef36fc7db/projects/rtmpose/examples/onnxruntime/main.py#L49
awesome! This exactly solved my problem. Thanks a lot.
sorry to reopen this issue. I noticed after I modified padding=1.25 to 1 as my config, some of the images still got the wrong results, although inference by SDK Python API with onnx models is still correct.
I also tried [https://github.com/Tau-J/rtmlib.git]()
from rtmlib.tools.pose_estimation.rtmpose import RTMPose
rtmpose = RTMPose(onnx_model='models/rtmpose_card.onnx',
model_input_size=(256, 256))
img = cv2.imread('images/RU1IQW9KMFNaaGdy20240122.jpg')
keypoints, scores = rtmpose(img, bboxes=[])
which still gives the wrong result and the result is the same as [https://github.com/open-mmlab/mmpose/blob/main/projects/rtmpose/examples/onnxruntime/main.py]()
Really appreciate for you help.
Solved. The input image is RGB rather than BGR. Just adding
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
in line 443 in https://github.com/open-mmlab/mmpose/blob/main/projects/rtmpose/examples/onnxruntime/main.py can solve my problem.
š The doc issue
Hi, Thanks for your great work. After deployment, I'm trying to inference with onnxruntime in Python of RTMPose-t model trained by my own dataset, but find the inference demo with onnxruntime only https://github.com/open-mmlab/mmpose/blob/main/projects/rtmpose/examples/onnxruntime/main.py gives a wrong result which is different from the prediction of torch model. However, when I use the example of SDK Python API from https://github.com/open-mmlab/mmpose/tree/main/projects/rtmpose with the deployed model, the result is the same as the prediction of torch model.
My datasets only have 4 keypoints.
Any hints for this problem or for the inference of RTMPose model by onnxrumtime only rather than using mmlab packages?Thanks a lot~
Below is my config for training:
Below is my command of model deployment:
Suggest a potential alternative/fix
No response