I am running a custom secondary model that needs to attach a Python dictionary to an object metadata NvDsObjectMeta. What is the suggested way to do this? Is there any workaround? I thought about a few solutions but they don’t seem to be right.
I was thinking about using the obj_meta.obj_user_meta_list but this does not seem like a good idea as secondary models will output their output tensor there. Any other place? Even if I could use the user_meta_list how can I allocate an object NvDsUserMeta so that the memory is owned by C++? There’s no method pyds.alloc_* for this.
I also looked for a way to create custom objects to attach to msg meta but there is no complete documentation on how to do it and I don’t know C++ very well How to use pyds with custom Object classes?
As a workaround I also tried to store some of the data using the classifier metadata, but this gives me a 6677 Segmentation fault (core dumped).
For instance:
I also understand the allocating objets using pyds.NvDsClassifierMeta() and pyds.NvDsLabelInfo()might be wrong because C++ needs to be control the memory ownership and not Python. However, there doesn’t seem to exist a pyds.alloc_* method for these two classes. Even if I wanted to use NvDsUserMeta I would have the same issue. There’s no function to allocate the its memory.
File "<ipython-input-2-07297b367dd4>", line 12, in <module>
payload.payload = buffer
TypeError: (): incompatible function arguments. The following argument types are supported:
1. (self: pyds.NvDsPayload, arg0: capsule) -> None
How do I convert a string to a capsule without writing C++ code? And what is this capsule object?