Getting Tracking ID

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson Xavier AGX
• DeepStream Version 6.0.1
• JetPack Version (valid for Jetson only) 4.6
• TensorRT Version 8.2.1

I am trying to get the object tracking ID from the tracking sample gpubootcamp/Introduction_to_Multi-DNN_pipeline.ipynb at a647a2c3fc75828cbbf1cbd5ab29f865c491a35c · openhackathons-org/gpubootcamp · GitHub . The labels on image below shows ID 2 and 18.

I beleived that I would get such IDs by accessing object_id, just like the code below:

while l_obj is not None:
    try:
        # Casting l_obj.data to pyds.NvDsObjectMeta
        obj_meta = pyds.NvDsObjectMeta.cast(l_obj.data)
    except StopIteration:
        break
    obj_counter[obj_meta.class_id] += 1
    obj_meta.rect_params.border_color.set(0.0, 0.0, 1.0, 1.0)
    obj_meta.text_params.font_params.font_color.set(1.0, 1.0, 1.0, 1.0)
    obj_meta.text_params.text_bg_clr.set(0.0, 0.0, 1.0, 1.0)
    # Get the object_id
    print("###### {}".format(obj_meta.object_id) )
    try:
        l_obj = l_obj.next
    except StopIteration:
        break

However, I always get the same number:

###### 18446744073709551615
###### 18446744073709551615

I am quite confused: (1) these shouldn’t be the same number, that is, two different objects, two different numbers; (2) I expected the number 2 and 18, just like de OSD, but I get these large integers. What am I missing here?

Thanks in advance,

Flávio Mello

As mentioned in the document

  • class_idint, Index of the object class infered by the primary detector/classifier
  • object_idint, Unique ID for tracking the object. @ref UNTRACKED_OBJECT_ID indicates the object has not been tracked

class_id may be what’s you want

Thanks

Not exactly

class_id provides the index of the object class that was inferred, but I already have this, and it is already mapped the label “Car”.

So, back to object_id, why it always shows me 18446744073709551615? I read the documentation previously and it says “Unique ID for tracking the object”, but this is not what is happening. I expected to receive the same ID from what is printed on the OSD (2 and 18, please, take a look at the image), or even a long integer, but it is not correct to show the same number.

This number 18446744073709551615 for object_id is weird. Despite Nvidia documentation say object_id type is int, it looks much like a memory address. However, this number is found often in Nvidia Forum, and it is unreasonable to believe that an memory address from my device is the same from another device.

The fact is: object_id is not being set!! This is the default value for object_id (Nvidia guys, recall to initialize variables with good values, it a good programming practice and helps other developers).

The problem is that the probe function (in my case: tiler_src_pad_buffer_probe) is actually used by pgie.get_static_pad("src"). And attention, the pgie element is before tracker in the pipeline, so the probe function will obtain wrong object id.

Just need to place the probe in the correct position: voilá.

In my case, just changed osdsinkpad = pgie.get_static_pad("src") to osdsinkpad = nvosd.get_static_pad("sink"). Since: ... -> pgie -> tracker -> nvosd -> ...

Case dismissed.

1 Like

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