NVDS Analytics Multiple Class Line Crossing Issue

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) : Tested on GTX 1060 Max-Q and Jetson TX2
• DeepStream Version : 5.0
• JetPack Version (valid for Jetson only) : 4.4
• TensorRT Version : 7.1.3
• NVIDIA GPU Driver Version (valid for GPU only) : 450.102.04

• Issue Type( questions, new requirements, bugs)
Bug
• 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)
We are trying to use the nvds-analytics plug in to create multiple ROIs and multiple line crossings with different class-ids, on one stream.
When using the nvds-analytics plugin defining multiple line-crossing or roi-filtering streams, the nvds-analytics plugin does not function as expected.
Using the following config with trafficcamnet we would expect roi-roi-1 to filter for cars, and roi-roi-2 to filter for people:

[property]
enable=1
config-width=3840
config-height=2160
osd-mode=2
display-font-size=12

[roi-filtering-stream-0]
enable=1
class-id=0
roi-roi-1=3224;1276;3376;1060;2692;880;2440;928;2276;896;2392;820;1828;732;1300;808

[roi-filtering-stream-0]
enable=1
class-id=2
roi-roi-2=2223;1275;3375;1059;2687;876;2439;927;2275;895;2391;819;1822;728;1296;804

However, in this scenario, both rois only filter for people. It seems like the first stream is being overwritten. Is there a way to support per ROI class filtering on one stream? Setting the class-ids to -1 allows both rois to count all classes, but would require writing a custom solution to filter to the intended class further in the pipeline.

We have noticed a similar issue with line counting.

Given the following config, we would expect line-crossing-1 to to count people and line-crossing-2 to count cars.

[property]
enable=1
config-width=3840
config-height=2160
osd-mode=2
display-font-size=12

[line-crossing-stream-0]
enable=1
class-id=2
extended=0
mode=loose
line-crossing-1=1835;1095;2786;1034;2908;936;2664;1132

[line-crossing-stream-0]
enable=1
class-id=0
extended=0
mode=loose
line-crossing-2=2835;1095;2786;1034;2908;936;2664;1132

However, in this scenario, only the cars are counted for line-crossing-2, and no people are counted for line crossing-1. Switching the order of the line-crossing-stream entries as per the following configure results in the opposite behavior, with only the people being counted and not the cars. Setting the class-id to -1 allows both line crossings to count both cars and people.

[property]
enable=1
config-width=3840
config-height=2160
osd-mode=2
display-font-size=12

[line-crossing-stream-0]
enable=1
class-id=0
extended=0
mode=loose
line-crossing-2=2835;1095;2786;1034;2908;936;2664;113

[line-crossing-stream-0]
enable=1
class-id=2
extended=0
mode=loose
line-crossing-1=1835;1095;2786;1034;2908;936;2664;1132

It appears that the nvds-analytics plugin does not support per-roi or per-line-crossing class configuration. It seems like this would be a common usecase, especially considering models like trafficnetcam that support multiclass detection per stream out of the box. Please let us know if you are aware of this problem and if there are any workarounds.

Thanks,
Michael

Hey, will check internally and update you ASAP.

Sorry for the late, yeah currently, we don’t support roi-roi-1 for class-id=0 and roi-roi-2 for class-id=2 in the same stream. We will add the feature in later release.