Created
August 25, 2020 06:15
-
-
Save satyajitghana/bb80a991b2d48f18c8b33627cabc9ea4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import onnxruntime | |
ort_session = onnxruntime.InferenceSession("simple_pose_estimation.quantized.onnx") | |
def to_numpy(tensor): | |
return tensor.detach().cpu().numpy() if tensor.requires_grad else tensor.cpu().numpy() | |
# compute ONNX Runtime output prediction | |
ort_inputs = {ort_session.get_inputs()[0].name: to_numpy(tr_img.unsqueeze(0))} | |
ort_outs = ort_session.run(None, ort_inputs) | |
ort_outs = np.array(ort_outs[0][0]) # to get 16x64x64 output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment