import cv2
import onnxruntime
import numpy as np
onnx_path_demo = '../data/weights/Yolo.onnx'
image_path = '../data/img/wastebag/0004.jpg'
image_src = cv2.imread(image_path)
resized = cv2.resize(image_src, (416, 416), interpolation=cv2.INTER_LINEAR)
img_in = cv2.cvtColor(resized, cv2.COLOR_BGR2RGB)
img_in = np.transpose(img_in, (2, 0, 1)).astype(np.float32)
img_in = np.expand_dims(img_in, axis=0)
img_in /= 255.0
session = onnxruntime.InferenceSession(onnx_path_demo)
input_name = session.get_inputs()[0].name