Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onnx Inference #19

Open
Zumbalamambo opened this issue Apr 8, 2021 · 1 comment
Open

Onnx Inference #19

Zumbalamambo opened this issue Apr 8, 2021 · 1 comment

Comments

@Zumbalamambo
Copy link

I'm using the following code to estimate the keypoints and matches using onnx

import json

import onnxruntime
import numpy as np
import cv2

path = "output/rgb.png"
img = cv2.imread(path)
img = cv2.resize(img, dsize=(640, 480), interpolation=cv2.INTER_AREA)
img.resize((1, 1, 640, 480))
data = json.dumps({'data': img.tolist()})
data = np.array(json.loads(data)['data']).astype('float32')
session = onnxruntime.InferenceSession("output/superpoint_640x480.onnx", None)
input_name = session.get_inputs()[0].name
output_name = session.get_outputs()[0].name

print(input_name)
print(output_name)

result = session.run([output_name], {input_name: data})
print(result)

How do I interpret the result? or is it the proper way of doing it?

@bb67ao
Copy link

bb67ao commented Dec 23, 2022

can you get a right result.I tried to make the whole spnet to onnx before,while got an error when inferenced with ort in c++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants