Deepstream test3 with tracker

Hi,

We are working with Deepstream 5.1 in python.
We’re trying to add a tracker element into deepstream test3 python. We’ve followed test2 as a sample, but still failed.
Here are some parts of our code in test3 related to tracker. Most of them are copy from test2 code.

# create tracker element
tracker = Gst.ElementFactory.make("nvtracker", "tracker")

# read tracker config
config.read('dstest2_tracker_config.txt')
# The parsing part is too long, i'm not pasting them here.
# They're the same as the code in test2.

# add pipeline
pipeline.add(pgie)
pipeline.add(tracker)
pipeline.add(tiler)
pipeline.add(nvvidconv)
pipeline.add(nvosd)
pipeline.add(sink)

# link
streammux.link(queue1)
ueue1.link(pgie)
pgie.link(tracker)
tracker.link(queue2)
queue2.link(tiler)
tiler.link(queue3)
queue3.link(nvvidconv)
nvvidconv.link(queue4)
queue4.link(nvosd)
nvosd.link(queueu5)
queue5.link(sink)

The code can run properly and there will be red bounding boxes in the display but without showing object id.
We’ve tried to obtain object id in probe function in python code

while l_obj is not None:
    try:
        # Casting l_obj.data to pyds.NvDsObjectMeta
        obj_meta=pyds.NvDsObjectMeta.cast(l_obj.data)
        print(obj_meta.obj_label, obj_meta.object_id)

The output looks like all the objects are set to a strange const integer.

Frame Number= 9 Number of Objects= 10 Timestamp= 1626087427.5311701
person 18446744073709551615
person 18446744073709551615
person 18446744073709551615
person 18446744073709551615
car 18446744073709551615
car 18446744073709551615
car 18446744073709551615
car 18446744073709551615
backpack 18446744073709551615
...

We use the same method to obtain object id in test2, and it works fine.

Frame Number=92 Number of Objects=16 Vehicle_count=9 Person_count=5
person 1
person 3
person 40
person 52
person 27
car 61
car 79
car 7
car 93
truck 80
backpack 10
...

Is there any config or setting that we missed?

I don’t have a solution to your problem but I came across this discussion which seemed relevant to the issue you are trying to solve:

Thanks,
Dilip.

Which tracker are you using? IOU,KLT or NvDCF?

Hi @Fiona.Chen,
We’ve tried both KLT and IOU, and got the same result with the strange object id.

The problem is that the function tiler_src_pad_buffer_probe in test3 python code is actually used by tiler_src_pad, which is pgie.get_static_pad("src"). The pgie element is before tracker in the pipeline, so the probe function will obtain wrong object id.

Modifying line 349 tiler_src_pad=pgie.get_static_pad("src") to
osdsinkpad = nvosd.get_static_pad("sink") will work.

Hello, I have the same problem (allways getting object_id=UNTRACKED_OBJECT_ID) and the probe is correctly linked to the osd sink.

Also I guess the tracker is doing nothing, because if I increment the inference interval, the tracker is not filling in the gaps between each inference. I am using NvDCF.

Also, checking the graph of the pipeline with xdot everything seems to be connected properly.

Can you give me any idea what could be happening?

new data, it seems it has something to do with the dewarper. If I insert it into the pipeline the tracker stops working