Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion rtmlib/tools/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,12 @@ def __init__(self,

elif backend == 'onnxruntime':
import onnxruntime as ort
providers = RTMLIB_SETTINGS[backend][device]
# 'cuda:device_id'
if (device not in RTMLIB_SETTINGS[backend]) and ("cuda" in device):
device_id = int(device.split(":")[-1])
providers = ('CUDAExecutionProvider', {'device_id': device_id})
else:
providers = RTMLIB_SETTINGS[backend][device]

self.session = ort.InferenceSession(path_or_bytes=onnx_model,
providers=[providers])
Expand Down