# Getting Tracking ID

**URL:** <https://forums.developer.nvidia.com/t/getting-tracking-id/254487>\
**Category:** DeepStream SDK\
**Created:** [May 26, 2023, 1:36am UTC](https://forums.developer.nvidia.com/t/getting-tracking-id/254487 "2023-05-26T01:36:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![flavio.mello](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@flavio.mello](https://forums.developer.nvidia.com/u/flavio.mello)\
**Post date:** [May 26, 2023, 1:36am UTC](https://forums.developer.nvidia.com/t/getting-tracking-id/254487/1 "2023-05-26T01:36:39Z")

</div>

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](https://github.com/openhackathons-org/gpubootcamp/blob/a647a2c3fc75828cbbf1cbd5ab29f865c491a35c/ai/DeepStream/English/python/jupyter_notebook/Introduction_to_Multi-DNN_pipeline.ipynb). The labels on image below shows ID 2 and 18.

 ![vlcsnap-other-00001](https://global.discourse-cdn.com/nvidia/original/3X/1/e/1e6cdb26141c5b155c2f6b6b2bf55ed2fdd13122.jpeg)

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

```auto
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:

```auto
###### 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

---

<div class="post-metadata">

**Author:** ![junshengy](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/junshengy/32/251332_2.png) [@junshengy](https://forums.developer.nvidia.com/u/junshengy)\
**Post date:** [May 26, 2023, 7:05am UTC](https://forums.developer.nvidia.com/t/getting-tracking-id/254487/3 "2023-05-26T07:05:27Z")

</div>

As mentioned in the [document](https://docs.nvidia.com/metropolis/deepstream/python-api/PYTHON_API/NvDsMeta/NvDsObjectMeta.html)

- **class\_id** – _int_, Index of the object class infered by the primary detector/classifier
- **object\_id** – _int_, 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

---

<div class="post-metadata">

**Author:** ![flavio.mello](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@flavio.mello](https://forums.developer.nvidia.com/u/flavio.mello)\
**Post date:** [May 26, 2023, 12:59pm UTC](https://forums.developer.nvidia.com/t/getting-tracking-id/254487/4 "2023-05-26T12:59:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![flavio.mello](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@flavio.mello](https://forums.developer.nvidia.com/u/flavio.mello)\
**Post date:** [May 29, 2023, 5:01pm UTC](https://forums.developer.nvidia.com/t/getting-tracking-id/254487/5 "2023-05-29T17:01:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [June 12, 2023, 5:01pm UTC](https://forums.developer.nvidia.com/t/getting-tracking-id/254487/6 "2023-06-12T17:01:59Z")

</div>

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