I made an application, based on deepstream-test1-app which add NvDsUserMeta on the object level. In the cpp version, I’ve successfully managed to get NvDsUserMeta through this snippet:
Long story short, I’ve modified libnvds_infer.so and libnvdsgst_infer.so. Hence, I’m attaching the NvDsUserMeta on object level in void attach_metadata_detector(...) function in the /opt/nvidia/deepstream/deepstream-4.0/sources/gst-plugins/gst-nvinfer/gstnvinfer_meta_utils.cpp file.
Thanks for the info. We’ll figure out how to bind user defined data generically. If we return a raw buffer of bytes, would you be able to make use of it?
In this particular case, I think yes. Since now the user data is presented as float array. But in case of more complex data structure it might be tricky.
For custom C structs, you can provide your own bindings with a cast function to cast pointer into the struct. You can use Pybind11 or maybe even Ctypes if the pointer deference works. In our bindings, pointers are returned as int (size_t in C). We’ll look into providing an example in our documentation.
I am also looking for accessing custom user meta data(array of int) inside python. But I could not find any example for doing this. Is there any new updates? It would be helpful if there is an example app in python like in cpp for user meta data.