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.
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.
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.
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.