Can't get the object_id of sgie parent

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) GPU
• DeepStream Version 6.1
• NVIDIA GPU Driver Version (valid for GPU only) 510.47.03
• Issue Type( questions, new requirements, bugs) bugs

The code in deepstream-appsrc-test is always error.
“track_id = obj_meta->parent->object_id;”

I need to get sgie parent object_id.
I can’t use “track_id = obj_meta->object_id;”.
That always get “-1”,

could you share your code diff? if no modification, obj_meta should be NULL, please refer to attach_metadata_detector() in deepstream SDK.

I used the deepstream-app code, I can use the object_id of sgie parent.

However, I used the deepstream-appsrc code, I can’t use the object_id of sgie parent.
It always appears error.

the default value of object_id is -1, object_id should not be -1 if enable tracker, did you see the object’s track-id on the video screen?

This is my screen. Screen is ok.

However, I wanna get object-parent-id from pgie.
It’s fail at deepstream-appsrc-test, but I can get it at deepstream-app.

Another words, original pipeline is “pgie=>tracker=>sgie”, I changed to “pgie=>sgie=>tracker”.

However, I don’t know how to map pgie-object-id to sgie-object-id.
I wanna know the sgie-object is from which pgie-object.

please use pgie->tracker->sgie pipeline , pgie will add object meta, this object 's object_id is -1, and its parent object is null, tracker will update object’s object-id.
please refer to attach_metadata_detector.

I mean

My first image is “pgie->tracker->sgie” pipeline.
My Second image is “pgie->sgie->tracker” pipeline.

All is fail, can’t get the object_id of sgie parent.

please refer to attach_metadata_detector.
=> I check the method of the gstnvinfer_meta_utils.cpp file.

Therefore, parent object is null, I should how get it? I wanna get parent object from sgie.
Because sgie object_id is “-1”, that’s not useful.

pgie will add object meta, sgie will not add object meta if sgie is classification, sgie will add classification meta to object, so if tracker is behind sgie, object-id will be -1 because this value will be updated by tracker.

My code in deepstream_main.c is following, it’s successful for getting object meta from sgie.

if (appCtx[i]->config.secondary_gie_sub_bin_config[1].enable) {
    GstPad *src_pad3 = NULL;
    GstElement *gst3 = appCtx[i]->pipeline.common_elements.secondary_gie_bin.sub_bins[1].secondary_gie;
    src_pad3 = gst_element_get_static_pad (gst3, "src");
    if (!src_pad3)
        g_print ("Unable to get secondary_gie0 src pad\n");
        gst_pad_add_probe(src_pad3, GST_PAD_PROBE_TYPE_BUFFER,
                  sgie1_src_pad_buffer_probe, NULL, NULL);
        gst_object_unref (src_pad3);

This part means I let sgie as pge to add object meta?

If I wanna write this part to deepstream_appsrc.c, have any advice?

Becasue I try to get it, it’s different as this part in deepstream_main.c.

“osd_sink_pad_buffer_probe” from osd_sink_pad.
“srcpad_buff_probe” from srcpad.

I still can’t get parent_object_track_id from sgie.

  1. this code is to add probe function sgie1_src_pad_buffer_probe on sgie’s src, you can also do this in deepstream_appsrc.c. osd is behind sgie, sgie and osd 's src alll are ok.
  2. if sgie is also a detection, it will add new object, the new object ‘s parent should be the object pgie added, then you can know the sgie-object is from which pgie-object. if sgie is classification, the objects are added by pgie, the objects’ s parent is NULL.

Thank you, it’s successfull.

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