deepstream-services-library icon indicating copy to clipboard operation
deepstream-services-library copied to clipboard

The pgie interval value does not seem to work when pipeline includes preproc plug-in [nvidia-bug]

Open YoungjaeDev opened this issue 3 years ago • 6 comments

Hello There is a problem that interval does not apply in the preproc cpp example. Is it supposed to be like that?

https://github.com/prominenceai/deepstream-services-library/blob/v0.26.alpha/examples/cpp/1file_preproc_pgie_iou_osd_window.cpp

// New Primary GIE using the filespecs defined above, with interval and Id
retval = dsl_infer_gie_primary_new(L"primary-gie", 
      primary_infer_config_file.c_str(), primary_model_engine_file.c_str(), 5);
if (retval != DSL_RESULT_SUCCESS) break;        

So I applied ode_monitor_action and printed it out, and the interval is continuously zeroing

image

I tried dsl_infer_interval_set=5 and it's the same

Thank you

YoungjaeDev avatar Jul 27 '22 08:07 YoungjaeDev

It's the same with gst-launch. Sounds like an interval problem with the nvidia deepstream Will raising the issue be a substitute to @NVIDIA?

gst-launch-1.0 filesrc location = /opt/nvidia/deepstream/deepstream-6.0/samples/streams/sample_1080p_h264.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! m.sink_0 nvstreammux name=m batch-size=1 width=1920 height=1080 ! nvvideoconvert ! nvdspreprocess config-file= /opt/nvidia/deepstream/deepstream-6.0/sources/gst-plugins/gst-nvdspreprocess/config_preprocess.txt  ! nvinfer config-file-path= /opt/nvidia/deepstream/deepstream-6.0/samples/configs/deepstream-app/config_infer_primary.txt input-tensor-meta=1 batch-size=7 interval=3 ! nvtracker tracker-width=480 tracker-height=272 ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so ll-config-file=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_tracker_IOU.yml ! nvmultistreamtiler width=1920 height=1080 ! nvvideoconvert ! nvdsosd ! nveglglessink

YoungjaeDev avatar Jul 27 '22 08:07 YoungjaeDev

https://forums.developer.nvidia.com/t/pgie-interval-setting-not-work-when-use-nvdspreprocessing/200634/9?u=yeongjae8066

YoungjaeDev avatar Jul 27 '22 08:07 YoungjaeDev

My deepstream is 6.0.1, above patch file soloved problem if your environment are 6.1, can you test it without patch file?

YoungjaeDev avatar Jul 27 '22 08:07 YoungjaeDev

@youngjae-avikus I'm also on 6.0.1 ... I may not get a change to upgrade for some time.

rjhowell44 avatar Jul 29 '22 01:07 rjhowell44

@rjhowell44

If preproc needs to update the file below at interval > 0 I think you can use it if you need it

--- gstnvinfer.cpp	2022-07-28 10:17:33.675674321 +0900
+++ gstnvinfer.cpp	2022-07-28 10:19:37.131624299 +0900
@@ -1863,6 +1863,14 @@
 
   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) {

YoungjaeDev avatar Jul 29 '22 01:07 YoungjaeDev

I should make a habit of creating a patch file from the file root :(

YoungjaeDev avatar Jul 29 '22 04:07 YoungjaeDev