Manual ROI Definition with nvinfer

Hello NVIDIA Developers,

I am working on a DeepStream pipeline where I want to:

  • Define a Region of Interest (ROI) manually using fixed coordinates (e.g., (x1, y1, x2, y2)).
  • Run inference only within the manually defined ROI using the nvinfer plugin.

I do not want to use nvdsanalytics for ROI definition. Instead, I need to hard-code the coordinates or specify them in the configuration.

Requirements:

  1. How can I manually specify an ROI in the pipeline?
  2. Is it possible to pass these coordinates directly to nvinfer or modify the frame buffer to exclude regions outside the ROI?

I would appreciate guidance on:

  • Changes required in configuration files.
  • Any custom pre-processing code or pipeline modifications to filter the frame based on the ROI.

If sample code or configuration examples are available, it would be greatly helpful.

Thank you for your support!

Hi, have you tried nvdspreprocess, it seems to do exactly what you need? It:

  • Extracts a ROI from the scene
  • Passes this area to the gst-nvinfer for detections
  • Does not modify the original buffer

No custom code needed.

Look here:
https://docs.nvidia.com/metropolis/deepstream/6.3/dev-guide/text/DS_plugin_gst-nvdspreprocess.html

1 Like

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