NvDsAnalytics metadata doesn't get displayed in the OSD

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) dGPU
• DeepStream Version 6.0
• JetPack Version (valid for Jetson only)
• TensorRT Version 8.0
• NVIDIA GPU Driver Version (valid for GPU only) 470.103, cuda 11.4
• Issue Type( questions, bugs)

I’m trying to use the NvDsAnalytics extension in graph-composer and it the direction-detection metadata doesn’t show in the OSD, while if I launch it with gst-launch-1.0 with the same config then the OSD has the direction labels.

I have an nvdsanalytics.txt as follows:

# The values in the config file are overridden by values set through GObject
# properties.

[property]
enable=1
#Width height used for configuration to which below configs are configured
config-width=1920
config-height=1080
#osd-mode 0: Dont display any lines, rois and text
#         1: Display only lines, rois and static text i.e. labels
#         2: Display all info from 1 plus information about counts
osd-mode=2
#Set OSD font size that has to be displayed
display-font-size=12


[line-crossing-stream-0]
enable=1
#Label;direction;lc
line-crossing-EgressUpper=460;250;460;150;0;200;680;200
line-crossing-IngressUpper=910;190;1030;290;800;240;1120;220
line-crossing-EgressLower=1300;470;1444;560;1080;518;1700;500
line-crossing-IngressLower=460;690;386;540;60;615;860;630
class-id=0;1
#extended when 0- only counts crossing on the configured Line
#              1- assumes extended Line crossing counts all the crossing
extended=0
#LC modes supported:
#loose   : counts all crossing without strong adherence to direction
#balanced: Strict direction adherence expected compared to mode=loose
#strict  : Strict direction adherence expected compared to mode=balanced
mode=balanced

[direction-detection-stream-0]
enable=1
#Label;direction;
direction-CityHall=480;450;460;285
direction-Airport=1134;355;1280;470
class-id=0;1
mode=loose

If I launch it with gst-launch-1.0, like so then everything works as expected:

gst-launch-1.0 filesrc location=demo.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! m.sink_0 nvstreammux name=m width=1920 height=1080 batch-size=1 live-source=0 ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-nvdsanalytics-test/nvdsanalytics_pgie_config.txt ! nvtracker ll-lib-file = /opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so ll-config-file=/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_tracker_NvDCF_perf.yml tracker-width=640 tracker-height=384 ! nvdsanalytics config-file=config_nvdsanalytics.txt ! nvvideoconvert ! nvdsosd ! nveglglessink

As you can see, “CityHall” and “Airport” show up on the OSD.

While if I launch the following graph (analytics-osd.yaml (6.5 KB)):

Then I get the same output, except the OSD doesn’t show the direction metadata.

Am I doing something incorrectly or the deepstream extension just doesn’t yet support this functionality?
Is there a way, maybe through a config file, I’d be able to do this?

Thanks in advance!

This seems very similar to the issue I am facing with Python: Can't see NvDsAnalytics ROI drawn on the image - #2 by mfoglio

@mfoglio If I add a ROI into the config section it does get drawn and it does count it. Does that not work for you? If I use the the sample config provided by the SDK the ROI RF part does get drawn and it does update correctly. I’m only missing the direction labels on the OSD.

I just fixed my issue. I needed to add nvosd after the nvdsanalytics plugin.

I’m glad! Unfortunately, as you can tell by my graph I already had the OSD after the Analytics module, but if it helped you solve your issue than it was already worth posting!

Unfortunately, my issue remains unsolved so far

There is no “/opt/nvidia/deepstream/deepstream/samples/configs/deepstream-app/config_nvdsanalytics.txt” in DS 6.0 GA SDK. How could you set it?

Hey @Fiona.Chen ! There is for me, it’s copied there. I fail to see the importance of the location of the config file as long as it’s a correct path. The contents of the file is the same as the one I posted in my original post. To be safe I’ve attached it as a file to this post as well.
config_nvdsanalytics.txt (1.3 KB)

So you need to remove the “reformat-object-labels: true” setting with nvidia::deepstream::NvDsOSD in your analytics-osd.yaml, or set “reformat-object-labels: false”

There are lots of parameters with each extensions, please set them while you know the meaning.

Thanks @Fiona.Chen! According to the docs with this parameter the OSD module reformats object labels with format [tracking id] . I guess in this case the Analytics component does not add a LABEL, but some additional meta data and that’s why? Could you confirm that? My guess is that NvDsAnalytics adds to NvOSD_TextParams and that’s what was missing from the reformatted OSD label?

You can use “gst-inspect-1.0 nvosdbin” to check the parameters.

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