DeepStream pgie detection data can't concatenate sgie detection data

Please provide complete information as applicable to your setup.

**• Hardware Platform (Jetson / GPU)**GPU
• DeepStream Version6.0.1
• TensorRT Version8.2.2.3
**• NVIDIA GPU Driver Version (valid for GPU only)**470
**• Issue Type( questions, new requirements, bugs)**questions

Hello Everybody,

I already integrated GitHub - NVIDIA-AI-IOT/deepstream_lpr_app: Sample app code for LPR deployment on DeepStream to deepstream-app.

My program is this following.

void
all_bbox_generated (AppCtx * appCtx, GstBuffer * buf,
NvDsBatchMeta * batch_meta, guint index)
{
gchar car_classifier_result[SIZE];
gchar lpr_result[SIZE];
for (NvDsMetaList * l_frame = batch_meta->frame_meta_list; l_frame != NULL;
l_frame = l_frame->next) {
NvDsFrameMeta *frame_meta = l_frame->data;
for (NvDsMetaList * l_obj = frame_meta->obj_meta_list; l_obj != NULL;
l_obj = l_obj->next) {
NvDsObjectMeta *obj = (NvDsObjectMeta *) l_obj->data;
memset(car_classifier_result,0,SIZE);
memset(lpr_result,0,SIZE);
if (obj->unique_component_id ==
(gint) appCtx->config.primary_gie_config.unique_id) {
for (NvDsMetaList * l_class = obj->classifier_meta_list; l_class != NULL; l_class = l_class->next) {
NvDsClassifierMeta *class_meta = (NvDsClassifierMeta *)(l_class->data);
for (NvDsMetaList * l_label = class_meta->label_info_list; l_label != NULL; l_label = l_label->next) {
NvDsLabelInfo *label_info = (NvDsLabelInfo *)l_label->data;
strcat(car_classifier_result, label_info->result_label);
strcat(car_classifier_result, " “);
}
}
}
else if (obj->unique_component_id == 2) {
for (NvDsMetaList * l_class = obj->classifier_meta_list; l_class != NULL; l_class = l_class->next) {
NvDsClassifierMeta *class_meta = (NvDsClassifierMeta *)(l_class->data);
for (NvDsMetaList * l_label = class_meta->label_info_list; l_label != NULL; l_label = l_label->next) {
NvDsLabelInfo *label_info = (NvDsLabelInfo *)l_label->data;
strcpy(lpr_result, label_info->result_label);
}
}
}
if(strcmp(lpr_result, “”) != 0){
g_print(”%s, %s\n", lpr_result, car_classifier_result);
}
}
}
}

However, I think pgie always first detect all car of the video frame, and then sgie detect car plate.(Left diagram)

But I wanna after pgie detect a car, and then detect car plate.(Right diagram)

Because my program output, always only car plate, otherwise only car data.
I can’t get them at the same time.

it’s my conifg.

deepstream_app_config.txt (5.0 KB)

The “parent” in NvDsObjectMeta contains the corresponding PGIE object with the object detected by SGIE. NVIDIA DeepStream SDK API Reference: _NvDsObjectMeta Struct Reference

Sorry… I don’t understand that.
How can I use the parent of SGIE?
Just like the following program?

But “the parent of sgie” always is null! It’s always stop program.

void
all_bbox_generated (AppCtx * appCtx, GstBuffer * buf,
NvDsBatchMeta * batch_meta, guint index)
{
gchar car_classifier_result[SIZE];
gchar lpr_result[SIZE];
for (NvDsMetaList * l_frame = batch_meta->frame_meta_list; l_frame != NULL;
l_frame = l_frame->next) {
NvDsFrameMeta *frame_meta = l_frame->data;
for (NvDsMetaList * l_obj = frame_meta->obj_meta_list; l_obj != NULL;
l_obj = l_obj->next) {
NvDsObjectMeta *obj = (NvDsObjectMeta *) l_obj->data;
memset(car_classifier_result,0,SIZE);
memset(lpr_result,0,SIZE);
if (obj->unique_component_id ==
(gint) appCtx->config.primary_gie_config.unique_id) {
for (NvDsMetaList * l_class = obj->classifier_meta_list; l_class != NULL; l_class = l_class->next) {
NvDsClassifierMeta *class_meta = (NvDsClassifierMeta *)(l_class->data);
for (NvDsMetaList * l_label = class_meta->label_info_list; l_label != NULL; l_label = l_label->next) {
NvDsLabelInfo *label_info = (NvDsLabelInfo *)l_label->data;
strcat(car_classifier_result, label_info->result_label);
strcat(car_classifier_result, " “);
}
}
}
else if (obj->unique_component_id == 2) {
for (NvDsMetaList * l_class = obj->classifier_meta_list; l_class != NULL; l_class = l_class->next) {
NvDsClassifierMeta *class_meta = (NvDsClassifierMeta *)(l_class->data);
for (NvDsMetaList * l_label = class_meta->label_info_list; l_label != NULL; l_label = l_label->next) {
NvDsLabelInfo *label_info = (NvDsLabelInfo *)l_label->data;
strcpy(lpr_result, label_info->result_label);
}
}
}
if(strcmp(lpr_result, “”) != 0){
g_print(”%s, %s\n", lpr_result, car_classifier_result);
}
}
}
//=====================================================
NvDsObjectMeta *parent_obj = (NvDsObjectMeta *) obj->parent;
for(NvDsMetaList * l_class = parent_obj->classifier_meta_list; l_class != NULL; l_class = l_class->next) {
NvDsClassifierMeta *class_meta = (NvDsClassifierMeta *)(l_class->data);
for (NvDsMetaList * l_label = class_meta->label_info_list; l_label != NULL; l_label = l_label->next) {
NvDsLabelInfo *label_info = (NvDsLabelInfo *)l_label->data;
g_print(“%s\n”, label_info->result_label);
}
}
//=====================================================
}

Yes, I solved that, it must be used at SGIE.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.