I noted that nvinfer maintains aspect ratio of images but either adds zero padding or symmetric padding. What kind of padding does TAO add?
And according to this post, when training a classification model, TAO will resize the images while keeping aspect ratio. Why Nvidia would recommend not setting maintain-aspect-ratio=1 in nvinfer config when using a TAO classification model with deep stream?
When run tao classification inference command , if enable_center_crop is false and enable_random_crop is false, the images will be loaded using Keras( load_img fromkeras_preprocessing/image/utils.py). Resizing does not keep aspect ratio.
If enable_ceter_crop is true or enable_random_crop is true, the resizing will keep aspect ratio. More info can be found in "enable_center_crop" in eval_config for Image Classification and how to pre-process image to also enable center crop for inference in Triton? - #5 by Morganh .
In deepstream inference, if TAO training setting is similar to above case 1, it is not needed to set maintain-aspect-ratio=1. If TAO training setting is similar to case2, it is suggested to set maintain-aspect-ratio=1.