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:
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.
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).
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.