Metadata Not Saved in Redis: Issue with Custom Graph Execution

Hi
I successfully ran the test4 example and saved the results in Redis.
Afterward, I ran my custom graph, which executed correctly, but the metadata was not saved in Redis. Why?


test4 :


my custom graph :

person detection → tracking → face detection → classifier 1 → classifier 2

You may save your graph file and compare it to the deepstream-test4 graph.

1 Like

Is this the same issue with Unable to Save Classifier Metadata to Redis in DeepStream Composer?

  1. For this information, the NvDsSampleProbeMessageMetaCreation extension needs your “person detection” model output “Person” label in object meta.
    You may need to check your PGIE configuration and label file.
  2. Since you have other classifiers which may change the label of the objects, it may impact the broker message generation. Are the two classifiers for “person” objects?

the two classifiers are designed specifically for “person” objects, with their functionality dependent on the face detection output. The pipeline works as follows:

  1. Person Detection: Detects person objects in the scene.
  2. Tracking: Tracks the detected person objects across frames.
  3. Face Detection: Identifies faces within the detected person objects.
  4. Classifier 1 (Gender): Uses the face detection output to classify the gender.
  5. Classifier 2 (Age): Utilizes the same face detection output to estimate age.

The object label will be changed by the classifiers. You may try to put the NvDsSampleProbeMessageMetaCreation extension directly after PGIE and make sure your PGIE label is “Person”.

The video display functions correctly, showing bounding boxes for all models, including classifiers and detectors.

However, I am facing an issue with sending the complete metadata (age, gender, etc.) to Redis. Based on my setup, I believe the model configurations are correct, as the video display works .

Could you please advise if there are additional configurations or plugins required to ensure that all metadata is sent to Redis? Any guidance or recommendations you could provide would be greatly appreciated.

Thank you for your time and support.

Example of the actual data sent to Redis

{
“messageid”: “4174825f-eaf1-4f78-9904-e36498836746”,
“mdsversion”: “1.0”,
@timestamp”: “2024-12-06T07:46:47.769Z”,
“place”: null,
“sensor”: null,
“analyticsModule”: null,
“object”: {
“id”: “18446744073709551615”,
“speed”: 0,
“direction”: 0,
“orientation”: 0,
“person”: {},
“bbox”: {
“topleftx”: 236,
“toplefty”: 41,
“bottomrightx”: 293,
“bottomrighty”: 265
},
“location”: {
“lat”: 0,
“lon”: 0,
“alt”: 0
},
“coordinate”: {
“x”: 0,
“y”: 0,
“z”: 0
},
“pose”: {}
},
“event”: {
“id”: “4151ccaf-0404-4f66-b33e-57bb5aa97977”,
“type”: “moving”
},
“videoPath”: “”
}


Here is the desired format of the metadata to send to Redis. Please suggest the necessary plugins and the integration position in my graph.

”id”: 1
“person”: {
“gender“:femme,
“age“:20},
“bbox”: {
“topleftx”: 236,
“toplefty”: 41,
“bottomrightx”: 293,
“bottomrighty”: 265
}

The gender and age information is not implemented in NvDsSampleProbeMessageMetaCreation extension. You may need to customize your own message meta generation extension.
https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_Zero_Coding_Developing_Extension.html#implementation-of-invdsinplacedatahandler

Is this solution for Graph Composer?

Could you provide guidance on how to incorporate the code for handling gender and age metadata into a custom extension?

Yes. For Graph Composer case.

The extension related sample is in Developing Extensions for DeepStream — DeepStream documentation. The msg meta generation, please refer to /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-test4/deepstream_test4_app.c, you need to generate the person object extra msg.

How can I generate a .c file for my custom graph to modify the custom data format, considering that Graph Composer generates a .yaml file?

The DeepStream extension libraries are not available for external users now. So it can’t be used to generate customized extension now.

Thank you for your response @Fiona.Chen . I understand that the DeepStream extension libraries are not currently available for external users.

However, I am specifically interested in creating a custom plugin, for example, one that handles metadata. Could you please guide me on how I might proceed with generating my own custom extension? Are there any alternative approaches or publicly available resources that I can leverage to achieve this?

The non-DeepStream extension development sample is in /opt/nvidia/graph-composer/extension-dev/README.

Hi, @amine.ghamgui.anavid

For your customized DeepStream extension, you may make use of the bazel rule “graph_nvidia_extension” in the WORKSPACE file to make use of whatever extension is required and add it as dependency in the app that is getting built.
Below is the example
graph_nvidia_extension(
name = “NvDsBaseExt”,
version = “1.6.0”,
)

anavid-server@anavidserver-B550-AORUS-ELITE-V2:~/new_new/test$ bazel build …
INFO: Analyzed 2 targets (49 packages loaded, 1214 targets configured).
INFO: Found 2 targets…
ERROR: /home/anavid-server/new_new/test/extensions/test/BUILD:7:19: Compiling extensions/test/HelloWorld.cpp failed: (Exit 1): g+±9 failed: error executing command (from target //extensions/test:libgxf_test.so) /usr/bin/g+±9 -MD -MF bazel-out/k8-opt/bin/extensions/test/_objs/libgxf_test.so/HelloWorld.d ‘-frandom-seed=bazel-out/k8-opt/bin/extensions/test/_objs/libgxf_test.so/HelloWorld.o’ … (remaining 84 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from extensions/test/HelloWorld.cpp:2:
extensions/test/HelloWorld.hpp:4:10: fatal error: extensions/nvdsinterface/interfaces.hpp: No such file or directory
4 | include “extensions/nvdsinterface/interfaces.hpp”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
INFO: Elapsed time: 1.883s, Critical Path: 1.43s
INFO: 121 processes: 103 internal, 17 linux-sandbox, 1 local.
FAILED: Build did NOT complete successfully

how to resolve this problem ???

@Fiona.Chen , No further modifications in the BUILD file or the WORKSPACE file ?

@amine.ghamgui.anavid

There are more modification needed. You need to add all DeepStream dependencies in the build workspace. You can refer to the WORKSPACE and BUILD files generated by Extension Development Workflow — DeepStream documentation