How to preprocess image before using model with onnxruntime?
XantaKross opened this issue · comments
XantaKross commented
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
- Resize the image to 32x32 before as input? And add another dimension?
- Break the image into 32x32 small patches then stack them into 10 different layers?
- Do something else?