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?
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;
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?