Simply inside the model should pre-processing be done; for inference, the user should only give the image path. Inside the onnx model, colour conversion and picture resizing will be performed. Please provide suggestions.
# Preprocessing of ONNX model
img = cv2.imread(testImage_path)
img=cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img = cv2.resize(img, dsize=(180, 180))
img.resize((1,180, 180, 3))
# Inference ONNX Model
ort_sess = ort.InferenceSession('./1/Image_Classific_Retrain_14022022_RGBInput.onnx')
input_name = ort_sess.get_inputs()[0].name
outputs = ort_sess.run(None, {input_name: img.tolist()})