Inconsistency with the extracted ReID tensor in deepstream

Please provide complete information as applicable to your setup.

• Hardware Platform (GPU)
• DeepStream Version 6.4
• TensorRT Version 8.6.1
• NVIDIA GPU Driver Version (535)
I updated the python bindings so that I’m able to extract the reid feature vector out. Although I found one inconsistency there that is the ReID tensor is not available for every object in every frame of the source. This is the code I’m using:

    l_batch_user=batch_meta.batch_user_meta_list
    while l_batch_user is not None:
        try:
            user_meta= pyds.NvDsUserMeta.cast(l_batch_user.data)
        except StopIteration:
            break
        if user_meta and user_meta.base_meta.meta_type == pyds.NVDS_TRACKER_BATCH_REID_META:
            pReidTensor = pyds.NvDsReidTensorBatch.cast(user_meta.user_meta_data)
            reidFeatures = pReidTensor.get_features()
        try:
            l_batch_user=l_batch_user.next
        except StopIteration:
            break

     while l_obj:
            try: 
                obj_meta=pyds.NvDsObjectMeta.cast(l_obj.data)
            except StopIteration:
                break

            while l_user_meta:
                try:
                    user_meta = pyds.NvDsUserMeta.cast(l_user_meta.data)
                    if user_meta and (user_meta.base_meta.meta_type == pyds.NVDS_TRACKER_OBJ_REID_META) and user_meta.user_meta_data:

                        reidInd_ptr = ctypes.cast(pyds.get_ptr(user_meta.user_meta_data), ctypes.POINTER(ctypes.c_int32))                
                        reidInd = reidInd_ptr.contents.value                        
                        if reidInd >= 0 and reidInd < pReidTensor.numFilled:
                            feature = reidFeatures[reidInd, :]

Here, I don’t get a feature for every object. For some of the objects it is missed out. Can you spot any error here, or is the ReID model doesn’t work on every object for every frame?

Reid Config:

ReID:
  reidType: 2    # The type of reid among { DUMMY=0, NvDEEPSORT=1, Reid based reassoc=2, both NvDEEPSORT and reid based reassoc=3}
  outputReidTensor: 1

  # [Reid Network Info]
  batchSize: 100    # Batch size of reid network
  workspaceSize: 1000    # Workspace size to be used by reid engine, in MB
  reidFeatureSize: 256    # Size of reid feature
  reidHistorySize: 100    # Max number of reid features kept for one object
  inferDims: [3, 256, 128]    # Reid network input dimension CHW or HWC based on inputOrder
  networkMode: 1    # Reid network inference precision mode among {fp32=0, fp16=1, int8=2 }

  # [Input Preprocessing]
  inputOrder: 0    # Reid network input order among { NCHW=0, NHWC=1 }. Batch will be converted to the specified order before reid input.
  colorFormat: 0    # Reid network input color format among {RGB=0, BGR=1 }. Batch will be converted to the specified color before reid input.
  offsets: [123.6750, 116.2800, 103.5300]    # Array of values to be subtracted from each input channel, with length equal to number of channels
  netScaleFactor: 0.01735207    # Scaling factor for reid network input after substracting offsets
  keepAspc: 1    # Whether to keep aspc ratio when resizing input objects for reid

  # [Output Postprocessing]
  addFeatureNormalization: 1       # If reid feature is not normalized in network, adding normalization on output so each reid feature has l2 norm equal to 1
  minVisibility4GalleryUpdate: 0.6 # Add ReID embedding to the gallery only if the visibility is not lower than this

  # [Paths and Names]
  # onnxFile: "/home/ubuntu/landmark/falcon-zone-analytics-deepstream/onnx_models/swin_tiny_market1501_aicity156_featuredim256.onnx"
  modelEngineFile: "onnx_models/resnet50_market1501_aicity156.onnx_b100_gpu0_fp16.engine"

Please upgrade to latest DeepStream 7.0. Please have a test on DeepStream 7.0. How you find the object miss the feature vector? Can you show some log?

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

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