Tau-J / rtmlib

RTMPose series (RTMPose, DWPose, RTMO, RTMW) without mmcv, mmpose, mmdet etc.
Apache License 2.0
232 stars 27 forks source link

onnxruntime-rocm #38

Open jschoch opened 1 month ago

jschoch commented 1 month ago

anyway to add support for ROCM?

jschoch commented 1 month ago

I believe all that is required is to set device = 'rocm' and then add this 'rocm': 'ROCMExecutionProvider', to tools/base.py

RTMLIB_SETTINGS = {
    'opencv': {
        'cpu': (cv2.dnn.DNN_BACKEND_OPENCV, cv2.dnn.DNN_TARGET_CPU),

        # You need to manually build OpenCV through cmake
        'cuda': (cv2.dnn.DNN_BACKEND_CUDA, cv2.dnn.DNN_TARGET_CUDA)
    },
    'onnxruntime': {
        'cpu': 'CPUExecutionProvider',
        'cuda': 'CUDAExecutionProvider',
        'rocm': 'ROCMExecutionProvider',
        'mps': 'CoreMLExecutionProvider' if check_mps_support() else 'CPUExecutionProvider'
    },
}
davidpagnon commented 1 month ago

Awesome! I just added these lines to both Pose2Sim and Sports2D. Hoping that you suggestion gets merged soon in RTMlib!

Tau-J commented 4 weeks ago

Thanks for your suggestion. Would you like to create a PR?

jschoch commented 4 weeks ago

pr pushed.