How to add custom data to NvDsObjectMeta?

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU): Jetson AGX Xavier
• DeepStream Version: 5.0
• JetPack Version (valid for Jetson only): 4.4
• TensorRT Version: 7.1.3
• Issue Type( questions, new requirements, bugs): question

I want to use a probe function to add custom metadata to NvDsObjectMeta, checking the nvdsmeta.h file, I narrow the candidate fields down to 2:

  /** Holds a pointer to a list of pointers of type @ref NvDsUserMeta. */
  NvDsUserMetaList *obj_user_meta_list;
  /** Holds additional user-defined object information. */
  gint64 misc_obj_info[MAX_USER_FIELDS]; 

My questions are:

  1. Which field should I use?
  2. None of the sample apps that works with custom metadata (deepstream-test4, deepstream-gst-metadata-test, deepstream-infer-tensor-meta-test) works directly with NvDsObjectMeta so would you please provide a high-level explanation of the steps that need to be done in order to attach custom metadata to NvDsObjectMeta?

You can refer to dsexample example。

Thank @RayZhang,

I can’t find an example app called “dsexample” so my questions remain unanswered.

You can refer How to pass the 5 landmarks of retinaface and perform face alignment between pgie and sgie? - #8 by mchi