DL-Art-School/codes/onnx_inference.py
2020-05-19 09:36:04 -06:00

10 lines
296 B
Python

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)