Extract ReIdentification vector in Deepstream-app

Please provide complete information as applicable to your setup.

• Hardware Platform (Jetson / GPU) RTX4070
• DeepStream Version 7.1
• TensorRT Version10.3.0.26-1+cuda12.5
I am using NVIDIA TAO Re-Identification (ReID) model for additional tracking.
In the main config file, it is sgie1.

 #reID Detection
[secondary-gie1]
enable=1
model-engine-file=../../models/Primary_Detector/peoplenet_models/resnet50_market1501_aicity156.onnx_b16_gpu0_fp16.engine
batch-size=16
gpu-id=0
gie-unique-id=5
operate-on-gie-id=1
operate-on-class-ids=0;
config-file=config_infer_secondary_2_reid_sasco.txt

This is config_infer_secondary_2_reid_sasco.txt config.

[property]
gpu-id=0
net-scale-factor=0.01735207357279195
offsets=123.675;116.28;103.53
model-color-format=0
onnx-file=../../models/Primary_Detector/peoplenet_models/resnet50_market1501_aicity156.onnx
model-engine-file=../../models/Primary_Detector/peoplenet_models/resnet50_market1501_aicity156.onnx_b16_gpu0_fp16.engine
infer-dims=3;256;128
batch-size=16
## 0=FP32, 1=INT8, 2=FP16 mode
network-mode=2
network-type=100
interval=0
process-mode=2
classifier-threshold=0
output-tensor-meta=1
maintain-aspect-ratio=0
operate-on-gie-id=1
operate-on-class-ids=0

I am trying to extract vector in gst-plugins.
The code is as below. embedding is always null.

 for (l_frame = batch_meta->frame_meta_list; l_frame != NULL;l_frame = l_frame->next)
    {
      
      frame_meta = (NvDsFrameMeta *) (l_frame->data);
      int have_objs = 0;
      for (l_obj = frame_meta->obj_meta_list; l_obj != NULL; l_obj = l_obj->next) {
      	 obj_meta = (NvDsObjectMeta *) (l_obj->data);
      	 
        
         std::vector<float> reid_vec; // empty = no embedding available this frame
         if (obj_meta->class_id == 0) { // PeopleNet person class
            for (NvDsMetaList *l_user = obj_meta->obj_user_meta_list; l_user != NULL;
                 l_user = l_user->next) {
               NvDsUserMeta *user_meta = (NvDsUserMeta *) (l_user->data);
               if (user_meta->base_meta.meta_type != NVDSINFER_TENSOR_OUTPUT_META)
                  continue;
               NvDsInferTensorMeta *tensor_meta =
                   (NvDsInferTensorMeta *) (user_meta->user_meta_data);
               if (tensor_meta->unique_id != REID_GIE_ID)
                   continue;
               if (tensor_meta->num_output_layers == 0 || tensor_meta->output_layers_info == nullptr)
                  break;
               NvDsInferLayerInfo &layer = tensor_meta->output_layers_info[0];
               float *embedding = (float *) layer.buffer;
               int dim = 1;               
               for (unsigned int i = 0; i < layer.inferDims.numDims; i++)
                  dim *= layer.inferDims.d[i];
               if (embedding == nullptr || dim <= 0)
                  break;
               reid_vec.assign(embedding, embedding + dim);
               // L2 normalize so stored vectors are directly comparable via cosine/dot product
               float norm = 0.0f;
               for (float v : reid_vec) norm += v * v;
               norm = std::sqrt(norm) + 1e-6f;
               for (float &v : reid_vec) v /= norm;
               break;
            }
         }
         std::time_t rawtime;
         std::time(&rawtime);
         queue.push(data_(rawtime, obj_meta->object_id, 0, posture),  frame_meta->source_id);//0 for the first shelve
         have_objs = 1;        
      }
    }

Pls see model output node below.

You can try to update to the latest version of DeepStream and refer to our sample deepstream-mdx-perception-app. This demonstrates how to use this model.