Deepstream back2back sgie's parent always None

DeepStream Version 6.2

I am following this repo deepstream_reference_apps/back-to-back-detectors at master · NVIDIA-AI-IOT/deepstream_reference_apps · GitHub and made it in python, for rtsp.

Detections are all good, but always i get for objects from SECONDARY None at parent call

this is the pipeline:
streammux.link(pgie)
pgie.link(tracker)
tracker.link(sgie1)
sgie1.link(tiler)
tiler.link(nvvideoconvert)
nvvideoconvert.link(nvosd)
nvosd.link(sink)

this is osd_sink_pad_buffer_probe:

def osd_sink_pad_buffer_probe(pad, info, u_data):
primary_obj_counter = {
PGIE_CLASS_ID_PERSON: 0,
PGIE_CLASS_ID_VEHICLE: 0,
}
secondary_obj_counter = {
SGIE_CLASS_ID_FACE: 0,
SGIE_CLASS_ID_LP: 0,
}

global frame_number
global SECOND_DETECTOR_IS_SECONDARY

gst_buffer = info.get_buffer()
if not gst_buffer:
    print("Unable to get GstBuffer ")
    return Gst.PadProbeReturn.OK

batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer))

l_frame = batch_meta.frame_meta_list
while l_frame is not None:
    frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data)

    l_obj = frame_meta.obj_meta_list
    while l_obj is not None:
        obj_meta = pyds.NvDsObjectMeta.cast(l_obj.data)

        if obj_meta.unique_component_id == PRIMARY_DETECTOR_UID:
            if obj_meta.class_id in [PGIE_CLASS_ID_PERSON, PGIE_CLASS_ID_VEHICLE]:
                # print(obj_meta.object_id)
                primary_obj_counter[obj_meta.class_id] += 1
        elif obj_meta.unique_component_id == SECONDARY_DETECTOR_UID:
            if obj_meta.class_id in [SGIE_CLASS_ID_FACE, SGIE_CLASS_ID_LP]:
                secondary_obj_counter[obj_meta.class_id] += 1
                print(obj_meta.parent)
                # if obj_meta.parent is not None:
                #     print("{} found for parent object id={}".format(sgie_classes_str[obj_meta.class_id], obj_meta.parent.object_id))

        l_obj = l_obj.next
    l_frame = l_frame.next

print("Frame Number:", frame_number, 
      "Person Count:", primary_obj_counter[PGIE_CLASS_ID_PERSON], 
      "Vehicle Count:", primary_obj_counter[PGIE_CLASS_ID_VEHICLE],
      "Face Count:", secondary_obj_counter[SGIE_CLASS_ID_FACE],
      "License Plate Count:", secondary_obj_counter[SGIE_CLASS_ID_LP])

frame_number += 1

return Gst.PadProbeReturn.OK

please check SECOND_DETECTOR_IS_SECONDARY’s value. if it is 1, the sgie will do inference on the object detected by pgie, and its parent will be not null; if it is not 1, the sgie will do inference on the full frame, and its parent will be null.
nvinfer plugin is opensource. you can add log in attach_metadata_detector to check.

after testing that C code without any modification, I can’t reproduce this issue. here is the log:
Frame Number = 0 Vehicle Count = 11 Person Count = 4 Face Count = 0 License Plate Count = 1
License plate found for parent object 0xfffed405aaf0 (type=Vehicle)
please compare the configuration and code logics with the C code.

python binding code is opensource. can you narrow down this issue? is a python app bug or python binding bug? thanks!

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

what is your GPU device model?

Please provide complete information as applicable to your setup.
• Hardware Platform (Jetson / GPU)
• DeepStream Version
• JetPack Version (valid for Jetson only)
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only)
• Issue Type( questions, new requirements, bugs)
• How to reproduce the issue ? (This is for bugs. Including which sample app is using, the configuration files content, the command line used and other details for reproducing)
• Requirement details( This is for new requirement. Including the module name-for which plugin or for which sample application, the function description)

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