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

How to preprocess image before using model with onnxruntime? #116

Open
XantaKross opened this issue Jan 7, 2024 · 1 comment
Open

How to preprocess image before using model with onnxruntime? #116

XantaKross opened this issue Jan 7, 2024 · 1 comment

Comments

@XantaKross
Copy link

Hey,

I was succesful in trying to run the .onnx model through opencv and python with a input size of (3, 640, 480) which becomes (1, 3, 480, 640) after the

print(img.shape) # (3, 640, 480) blob = self.net.blobFromImage(...) self.net.setInput(blob) print(blob.shape) # (1,3,480,640)

But I wish instead to run the model with onnxruntime inference. Which instead requires a input of size (10, 3, 32, 32)? Am I supposed to

  1. Resize the image to 32x32 before as input? And add another dimension?
  2. Break the image into 32x32 small patches then stack them into 10 different layers?
  3. Do something else?
@michalgrzyska
Copy link

Bump for this question, I cannot understand that input size as well. 32x32 makes no sense in case of image object recognition, same as batch = 10

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