* Check `'onnxruntime-gpu' if torch.has_cuda` * fix indentmodifyDataloader
# check_requirements(('opencv-python>=4.5.4',)) | # check_requirements(('opencv-python>=4.5.4',)) | ||||
net = cv2.dnn.readNetFromONNX(w) | net = cv2.dnn.readNetFromONNX(w) | ||||
else: | else: | ||||
check_requirements(('onnx', 'onnxruntime')) | |||||
check_requirements(('onnx', 'onnxruntime-gpu' if torch.has_cuda else 'onnxruntime')) | |||||
import onnxruntime | import onnxruntime | ||||
session = onnxruntime.InferenceSession(w, None) | session = onnxruntime.InferenceSession(w, None) | ||||
else: # TensorFlow models | else: # TensorFlow models |