How to get associated meta data for each object in Multi-level Detection with Deepstream

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) Jetson Xavier NX
• DeepStream Version 6.1.1
• JetPack Version (valid for Jetson only) 5.0.2 [L4T 35.1.0]
• TensorRT Version
• NVIDIA GPU Driver Version (valid for GPU only) 11.4
• Issue Type( questions, new requirements, bugs) question
• 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)


I’ve been developing a 3 stage ANPR (Automatic Number Plate Recognizer) on deepstream, by modifying deepstream-test2 application.

  1. PGIE - The primary detector is a vehicle detector and on top of that we are using a vehicle tracker.
  2. SGIE1 - It is a license plate detector which is operated on id 1
  3. SGIE2 - It is license plate reader gives the character for each license plate operating on id 2

All 3 models are object detector. However I have tried to take reference from deepstream_reference_apps/back-to-back-detectors at master · NVIDIA-AI-IOT/deepstream_reference_apps · GitHub but it does not address the issue I am currently facing.

I am trying to get the associated LP numbers for each vehicle. I have tried to get the data from unique ID however I am getting different obj_id for each unique ID.
For example: If a vehicle obj ID is 1 and unique ID is 1 for unique ID 2 it is not giving me the same obj ID rather it gives a random number.

So, is there any way so that we can get the data associated with each object detected by primary detector individually?

If you could give me some sort of direction or example as to how to aproach this, I would appreciate it.

Thanks and Regards.

There is an LPR sample already, it may be easier to get started based on it NVIDIA-AI-IOT/deepstream_lpr_app: Sample app code for LPR deployment on DeepStream (

Thanks for the reference. I am visiting the referenced code, however it used obj_meta->parent to associate the parent object of each license plate. I am using Python when I am doing the same (obj_meta.parent) I am getting None as parent.

How should I get the parent object for each detection?

The “parent” in NvDsObjectMeta will give you the parent object of the object from SGIE. NVIDIA DeepStream SDK API Reference: _NvDsObjectMeta Struct Reference

The parent in NvDsObjectMeta is returning ‘None’. I am not able to get the parent object for secondary detector meta data.
Problem: If there are n objects in the frame, I am getting all other secondary detectors meta data is associated with obj_id 1 only.
Kindly let me know how to get data associated with each object in all three detectors?

Where did you get “parent”?

Since I am new to deepstream, I do not have much understanding.
So, I am following the pipeline as illustrated in deepstream_python_apps/apps/deepstream-test2 at master · NVIDIA-AI-IOT/deepstream_python_apps · GitHub

I am getting parent in osd_sink_pad_buffer_probe() as following:
parent = obj_meta.parent
and here I am getting parent as ‘None’.

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

If you are using python deepstream-test2 sample, the best position of the probe should be reight after SGIE3 and before the nvvideoconvert(which will not copy parent in the meta).

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