Does NvInfer Add Padding?

Does NvInfer add padding to the input image?


Deep learning frameworks like pytorch and tensorflow should provide padding API or operations for tensor arrays.

For example, torch.nn.functional.pad (input, pad, mode='constant', value=0).
The documentation:

Add padding operation to your DL model should help.
You can then convert your model into ONNX and then tensorRT engine with padding included.

Tell me if you have problems with your model when converting it into tensorRT format.

I mean if I input one 16:9 video and the tensor input is 1:1, does NvInfer maintain the aspect ratio(padding) during image to tensor conversion or does it squeeze the horizontal axis(no padding) ?


Set maintain-aspect-ratio=1 in NvInfo configuration, 16:9 will pad to 16:16