Ds6.0: how can I reset nvdsanalytics state?

I am doing video analytics on prerecorded video files. At the end of each video clip, it appears the nvtracker is resetting the tracking IDs, however the internal states of nvdsanalytics is not reset, (in the OSD, I can see the line crossing counter starts with previous clip’s value), in result on the second video clip the line crossing would fail to detect line crossing.
the structure of the pipeline:
uridecodebin->nvstreammux->nvinfer->nvtracker->nvdsanalytics->nvstreamdemux->nvdsosd->nvoverlaysink

Is there a way to reset the nvdsanalytics state in ds6.0? Thanks.

Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

Deepstream version 6.0.
L4T: 32.7.5
Hardware: TX2.

could you share the screenshot of the first clip end and the second clip start? if objects change, new objects will get a new tracker id.

could you share some screenshot or video to elaborate this issue? Thanks!

Here’s how I reproduce this issue. The same mp4 was played back to back using the pipeline. When the first playback is done, in the EOS message callback, the pipeline is restarted by setting the state to NULL first, then to PLAYING.
Here’s what I observed:

  1. In the first run, everything looks normal. This is the screenshot of the first frame when vehicles are detected.
  2. In the second run, it looks mostly the same, but there are some subtle differences, that’s why I suspect some internal states were not reset with the EOS. Particularly: The two line crossing counters were not reset to zero, they kept previous values; car7 is not in the ROI, so the bounding box is red, while in the first run it is properly detected as in ROI.

    The consequence is later when the red car6 crossed the line, the lcStatus was never set and the LC counter didn’t change either.

Let me know if you need additional information. Thanks!

  1. How long is the mp4? will these cars in the screenshot disappear from the video? Noticing all trackerid did not changed in the second run. yes, line crossing counter is accumulative.
  2. nvdsanalytics plugin is opensource in DS6.3. you can reload the cfg to recreate low-level instance. By this way, all counter will start from 0. please refer to this topic for how to reload cfg.

Thanks for your reply, @fanzh.

  1. The clip is short, only about 10 seconds, but the red car of interest did get out of view.
  2. Since I am using TX2, I believe I am stuck at DS6.0, so that DS6.3 solution won’t apply to my situation. Correct me if I am wrong on this.