import numpy as np import cv2 BATCH_SIZE=1 PRECISION = np.float32 # If you get an error in this cell, restart your notebook (possibly your whole machine) and do not run anything that imports/uses Tensorflow/PyTorch from onnx_helper import ONNXClassifierWrapper trt_model = ONNXClassifierWrapper("ssd7keras_od.trt", [BATCH_SIZE, 1000], target_dtype = PRECISION) im = cv2.imread('1478899365487445082.jpg') im3 = np.expand_dims(im2, axis=0) print(im3.shape) # (1, 300, 480, 3) y_pred=trt_model.predict(im3) print(y_pred.shape) # (1, 1000)