How to Access and Print Object Direction Metadata from nvdsanalytics Plugin in DeepStream 7.1

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)
HI,
I would like to use the direction detection functionality of the nvdsanalytics plugin. I have correctly configured the parameters in the analytics config file (see below), and the plugin is running without errors.

My goal is to print the detected direction metadata (e.g., direction_LR, direction_TB, etc.) associated with each object detection during runtime. Is this possible? If so, how can I access and print this direction metadata from the plugin output—for instance, in a DeepStream custom probe or in the OSD stage?

Here is my current analytics configuration:

[property]
enable=1
osd-mode=2
display-font-size=6
config-width=1920
config-height=1080

[roi-filtering-stream-0]
enable=1
inverse-roi=0
class-id=-1
roi-zone_1=898;288;1551;309;1920;406;1920;500;1782;502;1640;452;1014;373; 
roi-frame=0;0;1920;0;1920;1080;0;1080;

[direction-detection-stream-0]
enable=1
class-id=-1
mode=loose

direction-direction_LR=0;540;1920;540;
direction-direction_RL=1920;540;0;540;

direction-direction_BT=960;1080;960;0;
direction-direction_TB=960;0;960;1080;

direction-direction_TL_BR=0;0;1920;1080;
direction-direction_TR_BL=1920;0;0;1080;
direction-direction_BL_TR=0;1080;1920;0;
direction-direction_BR_TL=1920;1080;0;0;

Any guidance on how to retrieve and print the direction data from the metadata attached to each object would be greatly appreciated.

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)

• Hardware Platform (Jetson / GPU):
GPU – NVIDIA L40S

• DeepStream Version:
7.1

• JetPack Version (valid for Jetson only):
N/A (using discrete GPU)

• TensorRT Version:
Aligned with DeepStream 7.1 recommended version

• NVIDIA GPU Driver Version (valid for GPU only):
Aligned with DeepStream 7.1 recommended version

• Issue Type (questions, new requirements, bugs):
Question

• How to reproduce the issue? (For bugs):
N/A – This is not a bug report

• Requirement Details (For new requirements):
We apologize for not providing complete information earlier.
I would like to use the direction detection functionality of the nvdsanalytics plugin in DeepStream 7.1. I have successfully configured the direction-related parameters in the analytics config file and confirmed the plugin is running without errors.

Now, I would like to access and print the direction metadata (such as direction_LR, direction_TB, etc.) for each detected object. My goal is to retrieve this information—for example, inside a DeepStream probe function—and either print it to the console or overlay it on the video output, as demonstrated in a related issue and sample video shared in this NVIDIA Developer Forum thread:
nvdsanalytics issues with directions

Here is the nvdsanalytics configuration I’m currently using:

[property]
enable=1
osd-mode=2
display-font-size=6
config-width=1920
config-height=1080

[roi-filtering-stream-0]
enable=1
inverse-roi=0
class-id=-1
roi-zone_1=898;288;1551;309;1920;406;1920;500;1782;502;1640;452;1014;373;
roi-frame=0;0;1920;0;1920;1080;0;1080;

[direction-detection-stream-0]
enable=1
class-id=-1
mode=loose

direction-direction_LR=0;540;1920;540;
direction-direction_RL=1920;540;0;540;

direction-direction_BT=960;1080;960;0;
direction-direction_TB=960;0;960;1080;

direction-direction_TL_BR=0;0;1920;1080;
direction-direction_TR_BL=1920;0;0;1080;
direction-direction_BL_TR=0;1080;1920;0;
direction-direction_BR_TL=1920;1080;0;0;

Is there a way to access and print the direction information from object metadata, such as within a probe after the analytics plugin? If yes, could you please guide me on how to do that (in C or Python)?

Thank you in advance for your support.

After nvdsanalytics, all analysis results will be added to user meta. please refer to parse_nvdsanalytics_meta_data of /opt/nvidia/deepstream/deepstream-7.1/sources/apps/sample_apps/deepstream-nvdsanalytics-test/deepstream_nvdsanalytics_meta.cpp. you can get direction metadata from user meta with type NVDS_USER_OBJ_META_NVDSANALYTICS of NvDsUserMeta. Here is a sample log:

object 5 moving in North

Thanks for the explanation. Just to clarify — is it possible to display the direction metadata (e.g., “moving in North”) directly on the video using the nvdsosd plugin, by accessing the user metadata added by nvdsanalytics?

If so, can this be done by parsing the NVDS_USER_OBJ_META_NVDSANALYTICS metadata and assigning the direction info to obj_meta->text_params.display_text before the nvdsosd stage?

Please add a displaymeta for displaying direction metadata with osd plugin. please refer to osd_sink_pad_buffer_probe of deepstream-test1.

Thanks, also I would like to include the object direction (e.g., the dirStatus from nvdsanalytics) in my custom message sent to Kafka via nvmsgbroker.

Is there a standard or recommended way to access this direction value and include it in the message payload?

Please refer to parse_nvdsanalytics_meta_data of /opt/nvidia/deepstream/deepstream-7.1/sources/apps/sample_apps/deepstream-nvdsanalytics-test/deepstream_nvdsanalytics_meta.cpp for how to get dirStatus information.
Please refer to this payload-with-custom-objects for how to add custom messages.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks.

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