Star-Clouds / CenterFace

face detection

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to preprocess image before using model with onnxruntime?

XantaKross opened this issue · comments

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?