DL-Art-School/codes/onnx_inference.py

10 lines
296 B
Python
Raw Normal View History

2020-05-19 15:36:04 +00:00
import onnxruntime
import numpy as np
import time
session = onnxruntime.InferenceSession("../results/gen.onnx")
v = np.random.randn(1,3,1700,1500)
st = time.time()
prediction = session.run(None, {"lr_input": v.astype(np.float32)})
print("Took %f" % (time.time() - st))
print(prediction[0].shape)