Does nvinfer resizes images as a preprocessing?

According to the document below, nvinfer seems to do preprocess image(performs normalization and mean subtraction).


https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinfer.html

I was able to do inference with command below.
gst-launch-1.0 -e filesrc location=/opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! m.sink_0 nvstreammux name=m width=1280 height=720 batch-size=1 ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_infer_primary.txt ! nvvideoconvert ! 'video/x-raw(memory:NVMM), format=RGBA' ! nvdsosd ! nvvideoconvert ! autovideosink sync=0

In this inference, “resnet10.caffemodel” is used.
This model seems to expect NCHW(1,3,368,640) formatted data.
However, the command above inputs frame with width=1280 height=720.

I think nvinfer automatically resizes frame as a preprocess because there is no description about resize in config_infer_primary.txt.

Does nvinfer automatically resizes images as a preprocessing?

Yes. If you don’t set the input-tensor-from-meta=1 parameters, it will do pre-process inside.

Can we set interpolation method for resizing?(e.g. nearest neighbor))

Yes. You can set the scaling-filter parameter ot change the algorithm. For more other parameters, please refer to our Guide first.
https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvinfer.html#id2

Thank you.
I have another question.
If I have nvinfer to preprocess including padding, is padding executed after normalize and resize?

e.g.) RGB to BGR→normalize → resize→padding

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

The code and algorithms in this section are open-source, please refer to the source code directly.

sources\libs\nvdsinfer
sources\gst-plugins\gst-nvinfer

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.