For the preprocessing of a RGB image,
- do not change aspect_ratio, then resize(img.resize) the original image
- create(image.new) an image which corresponds to model input width/height
- paste(image.paste) (1) to (2)
- inf_img = np.array(inf_img).astype(np.float32)
inference_input = preprocess_input(inf_img.transpose(2, 0, 1))
More, suggest you to run deepsteam inference to check the result firstly.
Make sure deepstream can run your trt engine correctly comparing to tlt-infer.