Unique_component_id in NvDsObjectMeta doesn't change

Hi. What does unique_component_id correspond to in pyds.NvDsObjectMeta
( NvDsObjectMeta — Deepstream Deepstream Version: 8.0 documentation )?

I initially thought it mapped to the gie-unique-id field in the nvinfer configuration. However, unique_component_id is consistently 0, even when I assign different values to gie-unique-id.

I’m looking for a consistent way to identify which model produced a given object so that I can apply the appropriate post-processing logic.

Here’s my nvinfer config for binary-classification model:

[property]
gpu-id=0
net-scale-factor=0.007843137255
offsets=127.5;127.5;127.5
model-color-format=0 # 0=RGB, 1=BGR
model-engine-file=binary_model.engine
labelfile-path=labels.txt
network-input-order=0
batch-size=1
network-type=1 # classifier
process-mode=1
gie-unique-id=1
classifier-threshold=0.1
scaling-compute-hw=2
interval=0
maintain-aspect-ratio=1

• Hardware Platform (Jetson / GPU): Nvidia Jetson AGX ORIN
• DeepStream Version: DeepStreamSDK 7.1.0
• TensorRT Version: 10.3

Noticing classification model is pgie, the object meta will be added by attach_metadata_classifier of nvinfer plugin. Currently there is a bug: obj_meta->unique_component_id is not set in attach_metadata_classifier.
Since nvinfer is opensource, Here is a workaround.

  1. Enter /opt/nvidia/deepstream/deepstream/sources/gst-plugins/gst-nvinfer, In function attach_metadata_classifier of gstnvinfer_meta_utils.cpp, add the following code after object_meta is created, that is, object_meta = nvds_acquire_obj_meta_from_pool (batch_meta).
obj_meta->unique_component_id = nvinfer->unique_id;
  1. run export CUDA_VER=12.6 && make
  2. run cp /opt/nvidia/deepstream/deepstream/lib/gst-plugins/libnvdsgst_infer.so /opt/nvidia/deepstream/deepstream/lib/gst-plugins/libnvdsgst_infer.so_ori && cp libnvdsgst_infer.so /opt/nvidia/deepstream/deepstream/lib/gst-plugins

I see that classifier_meta.unique_component_id inside the object_meta.classifier_meta_list correctly corresponds to the gie-unique-id in the nvinfer config, but handling it like that makes the the resulting code unnecessarily cluttered.

Is there any estimated date for the release of the fixed version?

How is unique_component_id currently defined, and is its value guaranteed to be unique and consistent? I plan to use it for post-processing the inference results and want to ensure it cannot be duplicated across different models.

Yes, noticing classifier_meta->unique_component_id has been set in attach_metadata_classifier(), you can use classifier_meta->unique_component_id instead of obj_meta->unique_component_id.
In attach_metadata_classifier(), classifier_meta->unique_component_id is set to nvinfer->unique_id, which represents gie-unique-id in nvinfer configuration file.