How to parse custom data from custom_parser_function back to pipeline

Hi,

I managed to obtain the inference output from model in my custom parser function. After some processing, the final output is a bounding box and a 128 elements array. My question is, how can i send the 128 elements array back to the pipeline to proceed to next stage?

The given NvDsInferObjectDetectionInfo can only send bounding box and its class back. Is there any way for me to customize it and add additional fields to it?

I read in some other post, somebody mentioned using priv_data could be a solution.

Is there any example or further guides on how priv_data can be implemented?

Thanks

please provide the setup info as other ticket, thanks!

**• Hardware Platform: RTX2080ti
**• DeepStream Version: 5.0
**• TensorRT Version: 7.0.0.11
• NVIDIA GPU Driver Version: 450.66

Hi @chionjetherng,
No such sample. If the inference is detection, you could put the data in below two fields of NvDsObjectMeta structure.

  /** 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];   // **MAX_USER_FIELDS = 4**

======

typedef struct _NvDsObjectMeta {
  NvDsBaseMeta base_meta;
  /** Holds a pointer to the parent @ref NvDsObjectMeta. Set to NULL if
   no parent exists. */
  struct _NvDsObjectMeta *parent;
  /** Holds a unique component ID that identifies the metadata
   in this structure. */
  gint unique_component_id;
  /** Holds the index of the object class inferred by the primary
   detector/classifier. */
  gint class_id;
  /** Holds a unique ID for tracking the object. @ref UNTRACKED_OBJECT_ID
   indicates that the object has not been tracked. */
  guint64 object_id;
  /** Holds a confidence value for the object, set by the inference
   component. Confidence will be set to -0.1, if "Group Rectangles" mode of
   clustering is chosen since the algorithm does not preserve confidence
   values */
  gfloat confidence;
  /** Holds a structure containing positional parameters of the object
   in the frame. Can also be used to overlay borders or semi-transparent boxes
   on objects. @see NvOSD_RectParams. */
  NvOSD_RectParams rect_params;
  /** Holds text describing the object. This text can be overlayed on the
   standard text that identifies the object. @see NvOSD_TextParams. */
  NvOSD_TextParams text_params;
  /** Holds a string describing the class of the detected object. */
  gchar obj_label[MAX_LABEL_SIZE];
  /** Holds a pointer to a list of pointers of type @ref NvDsClassifierMeta. */
  NvDsClassifierMetaList *classifier_meta_list;
  /** 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];
  /** For internal use. */
  gint64 reserved[MAX_RESERVED_FIELDS];
}NvDsObjectMeta;

Hi @mchi,

Let’s say the inference outputs are a bounding box (with left,top,width,height,confidence) and landmarks, the method in nvdsinfer_custom_impl.h :

typedef bool (* NvDsInferInstanceMaskParseCustomFunc) (
    std::vector<NvDsInferLayerInfo> const &outputLayersInfo,
    NvDsInferNetworkInfo  const &networkInfo,
    NvDsInferParseDetectionParams const &detectionParams,
    std::vector<NvDsInferInstanceMaskInfo> &objectList);

can only return bounding box, confidence and class id. How do i include the landmarks so that it can be parse to the next stage? How’s the NvDsObjectMeta that you suggested can be implemented?

Thanks

Hi @chionjetherng,
Seems you filed two tickets for the same question, the other is How to pass the 5 landmarks of retinaface and perform face alignment between pgie and sgie? , could you close one of them?

Thanks!