Pgie interval setting not work when use nvdspreprocessing

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU): GPU
• DeepStream Version: 6.0
• TensorRT Version: 8.2
• NVIDIA GPU Driver Version (valid for GPU only): 470.82
• Issue Type( questions, new requirements, bugs): question

Hi, I recently started using nvdspreprocessing to recognize objects at specific ROIs for different sources, I was able to implement such plugin in my python code, but I noticed that the interval option that allows inferring every N frame doesn’t work as expected (process all the frame) when I use nvdspreprocessing, before that this option worked fine.
So I tried to use the interval option in the provided C++ example /opt/nvidia/deepstream/deepstream-6.0/sources/apps/sample_apps/deepstream-preprocess-test/deepstream_preprocess_test.cpp but when using the option the application continues processing each one of the frames

In python I also tried to set the interval option by code (pgie.set_property('interval', 30)) but it didn’t work either

Is there anything else I need to configure to get the expected result of the interval option?

Hello, any possible help regarding this question?

Need to have a check. nvinfer is open source, can you help to check it?

I’ve tried but I’m not an expert in C/C++, but I don’t think it has to do with nvinfer, because as I mentioned, the interval parameter works correctly when I DON’T USE nvdspreprocessing.

Another point to add to my question is that in the deepstream_preprocess_test.cpp example, when I set up one stream with ROI and a second stream without ROI (so that it processes the entire frame), it only makes inferences about stream 1 in the ROI, and the stream 2 does not generate any bounding box.

nvinfer will change to process meta data if nvdspreprocessing is added.

I’m still looking for a way to make it work, I would appreciate it if you could be clearer with your answer to give it the correct interpretation and make the integration work, I don’t know how what you say helps me

hello again, someone out there who can help me? I can’t find a solution

Can you help to have a try with below patch:

$ cd /opt/nvidia/deepstream/deepstream-6.0

diff --git a/sources/gst-plugins/gst-nvinfer/gstnvinfer.cpp b/sources/gst-plugins/gst-nvinfer/gstnvinfer.cpp
index 3abe78e..1d97536 100755
--- a/sources/gst-plugins/gst-nvinfer/gstnvinfer.cpp
+++ b/sources/gst-plugins/gst-nvinfer/gstnvinfer.cpp
@@ -1863,6 +1863,14 @@ gst_nvinfer_process_tensor_input (GstNvInfer * nvinfer, GstBuffer * inbuf,

   std::unique_ptr<GstNvInferBatch> batch = nullptr;
   std::vector<NvDsInferLayerInfo> tensors;
+  gboolean skip_batch;
+  /* Process batch only when interval_counter is 0. */
+  skip_batch = (nvinfer->interval_counter++ % (nvinfer->interval + 1) > 0);
+  if (skip_batch) {
+    return GST_FLOW_OK;
+  }

   for (NvDsMetaList * l_user = batch_meta->batch_user_meta_list; l_user != NULL;
       l_user = l_user->next) {
1 Like

Hello, thank you very much for answering, I compiled the patch you send me and it works perfectly for my purpose.

But… I noticed that if you want to process a source with ROI, and another one without ROI (to process the complete frame), for the second one it doesn’t perform any recognition, it only does it for the one with assigned ROI.

this is what I wnat to say (config_preprocess.txt)


running with this line:
./deepstream-preprocess-test config_preprocess.txt config_infer.txt file:///opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_1080p_h264.mp4 file:///opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_1080p_h264.mp4

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