You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for bbox, label in zip(outputs[0][0], outputs[1][0]):
print('label: {}, bbox: {}'.format(label, bbox))`
i conver yolox to onnx with detection_onnxruntime_dynamic.py, but when inference image with onnxruntime, no speed increase.
Besides ort.InferenceSession(model_path, providers=['CUDAExecutionProvider']) cost 2.4s, ort.InferenceSession(model_path, providers=['CPUExecutionProvider']) cost0.18s instead. could anyone can explain it?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
`import onnx
import onnxruntime as ort
import numpy as np
import cv2
import time
model_path = 'weights/end2end.onnx'
onnx_model = onnx.load(model_path)
onnx.checker.check_model(onnx_model)
image = cv2.imread('images/demo.jpg').astype('float32')
image = cv2.resize(image, (640, 640), interpolation=cv2.INTER_AREA).reshape(3, 640, 640)
image = np.expand_dims(image, axis=0)
t = time.time()
ort_sess = ort.InferenceSession(model_path, providers=['CPUExecutionProvider'])
tcost = time.time() - t
print(f"tcost = {tcost}")
outputs = ort_sess.run(None, {'input': image})
print('batch size: {}'.format(len(outputs[0])))
print('Num of detection: {}'.format(len(outputs[0][0])))
for bbox, label in zip(outputs[0][0], outputs[1][0]):
print('label: {}, bbox: {}'.format(label, bbox))`
i conver yolox to onnx with detection_onnxruntime_dynamic.py, but when inference image with onnxruntime, no speed increase.
Besides
ort.InferenceSession(model_path, providers=['CUDAExecutionProvider'])
cost 2.4s,ort.InferenceSession(model_path, providers=['CPUExecutionProvider'])
cost0.18s instead. could anyone can explain it?Beta Was this translation helpful? Give feedback.
All reactions