NVIDIA DeepStream SDK API Reference

9.2 Release
ReID Class Reference

Detailed Description

ReID module to extract deep ReID features from input frames and detected bounding boxes and save them in GPU memory.

Definition at line 95 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

Inheritance diagram for ReID:
Collaboration diagram for ReID:

Public Member Functions

 ReID (const std::string &configFilePath)
 Construct a ReID instance from configuration. More...
 
 ReID (const std::string &configFilePath, const std::string &modelName, const bool calDisMaha=true)
 Construct a ReID instance from configuration. More...
 
virtual ~ReID ()
 Release resources owned by the ReID instance. More...
 
void initializeRuntime (const SourceFrameInfo &frameInfo, const uint maxTargetsPerStream, const std::shared_ptr< NvTrackedObjectManager > &targetManager) override
 Initialize variables and allocate memories. More...
 
void initializeModel () override
 Create TensorRT inference engine; if engine does not exist, serialize from model file. More...
 
void queryParams (NvMOTQuery &paramsQuery)
 Populate the capabilities reported to the tracker. More...
 
void doInference (const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta, std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &detectedObjects, const bool isForReAssoc) override
 Extract ReID features from input images and save them in m_reidFeaturesDet_d. More...
 
void update () override
 Update ReID feature gallery after data association. More...
 
void removeStream (const NvMOTStreamId videoStreamId) override
 Remove a stream's reid features. More...
 
void outputReIDTensor (NvDsReidTensorBatch &reidTensorBatch) override
 Output the ReID tensor of a batch. More...
 
int outputTargetReIDInd (NvMOTStreamId streamId, uint targetInd) override
 Output a target's ReID vector index in the batch tensor. More...
 
void outputTargetReIDObj (NvMOTStreamId streamId, uint targetInd, NvDsReidTensorBatch &reidTensorBatch, NvDsObjReid &reidObj) override
 Output a target's ReID vector information. More...
 
void getFeatures2Host ()
 Copy ReID features from device memory to host memory. More...
 
bool isModelInitialized () override
 Report whether the inference model is initialized. More...
 
bool isRuntimeInitialized () override
 Report whether runtime resources are initialized. More...
 
const REID_TYPES getReIDType () override
 Get the configured ReID implementation type. More...
 
 ReID (const std::string &configFilePath)
 Construct a ReID instance from configuration. More...
 
 ReID (const std::string &configFilePath, const std::string &modelName, const bool calDisMaha=true)
 Construct a ReID instance from configuration. More...
 
virtual ~ReID ()
 Release resources owned by the ReID instance. More...
 
void initializeRuntime (const SourceFrameInfo &frameInfo, const uint maxTargetsPerStream, const std::shared_ptr< NvTrackedObjectManager > &targetManager) override
 Initialize variables and allocate memories. More...
 
void initializeModel () override
 Create TensorRT inference engine; if engine does not exist, serialize from model file. More...
 
void queryParams (NvMOTQuery &paramsQuery)
 Populate the capabilities reported to the tracker. More...
 
void doInference (const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta, std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &detectedObjects, const bool isForReAssoc) override
 Extract ReID features from input images and save them in m_reidFeaturesDet_d. More...
 
void update () override
 Update ReID feature gallery after data association. More...
 
void removeStream (const NvMOTStreamId videoStreamId) override
 Remove a stream's reid features. More...
 
void outputReIDTensor (NvDsReidTensorBatch &reidTensorBatch) override
 Output the ReID tensor of a batch. More...
 
int outputTargetReIDInd (NvMOTStreamId streamId, uint targetInd) override
 Output a target's ReID vector index in the batch tensor. More...
 
void outputTargetReIDObj (NvMOTStreamId streamId, uint targetInd, NvDsReidTensorBatch &reidTensorBatch, NvDsObjReid &reidObj) override
 Output a target's ReID vector information. More...
 
void getFeatures2Host ()
 Copy ReID features from device memory to host memory. More...
 
bool isModelInitialized () override
 Report whether the inference model is initialized. More...
 
bool isRuntimeInitialized () override
 Report whether runtime resources are initialized. More...
 
const REID_TYPES getReIDType () override
 Get the configured ReID implementation type. More...
 

Protected Member Functions

void extractImagePatchesBatch (const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta, std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &detectedObjects)
 Crop input frames using detected bboxes and rescale them as ReID network input size. More...
 
void generateImagePatchesWithSegmentationMask (std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &detectedObjects)
 Multiply segmentation mask with image patches for ReID input. More...
 
void removeTrackerReIDFeature (const NvMOTStreamId videoStreamId, const std::shared_ptr< NvTrackedObject > target)
 Removed a target's all reid features. More...
 
void computeReIDFeatureDist (const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta)
 Compute reid feature distance between detection and trackers. More...
 
void multiplyReIDFeatures (const int streamInd, const NvMOTStreamId videoStreamId)
 Compute dot products between detection and gallery ReID features. More...
 
void normalizaReIDFeatures ()
 Normalize ReID network output to ensure l2 norm equals to 1. More...
 
void computeMahalanobisDist (DisMahalanobisIn in)
 Compute Mahalanobis distance for NvDeepSORT tracker. More...
 
void extractImagePatchesBatch (const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta, std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &detectedObjects)
 Crop input frames using detected bboxes and rescale them as ReID network input size. More...
 
void generateImagePatchesWithSegmentationMask (std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &detectedObjects)
 Multiply segmentation mask with image patches for ReID input. More...
 
void removeTrackerReIDFeature (const NvMOTStreamId videoStreamId, const std::shared_ptr< NvTrackedObject > target)
 Removed a target's all reid features. More...
 
void computeReIDFeatureDist (const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta)
 Compute reid feature distance between detection and trackers. More...
 
void multiplyReIDFeatures (const int streamInd, const NvMOTStreamId videoStreamId)
 Compute dot products between detection and gallery ReID features. More...
 
void normalizaReIDFeatures ()
 Normalize ReID network output to ensure l2 norm equals to 1. More...
 
void computeMahalanobisDist (DisMahalanobisIn in)
 Compute Mahalanobis distance for NvDeepSORT tracker. More...
 

Protected Attributes

bool m_isModelInit
 Reid status if reid model initialized. More...
 
bool m_isRuntimeInit
 Reid status if runtime variables initialized. More...
 
ReIDConfigParams m_params
 Config params for reid module. More...
 
TrtModule m_inference
 TensorRT module that runs the reid network. More...
 
std::shared_ptr< ReIDFeatureGallery > m_reidFeatureGallery
 ReID feature gallery for target management. More...
 
std::shared_ptr< NvTrackedObjectManager > m_targetManager
 Target manager providing target status to update feature gallery. More...
 
bool m_calDisMaha
 If the module needs to compute Mahalanobis distance. More...
 
int m_maxTargetsToTrack
 Max number of targets to keep for all streams. More...
 
int m_maxTargetsPerStream
 Max number of targets to keep per stream. More...
 
int m_maxStreams
 Max number of streams. More...
 
int m_numBboxes
 Number of detected boxes in the current batch tracker recieved. More...
 
NvMotDataTypes::Size m_srcImageSize
 Tracker library frame size. More...
 
std::map< NvMOTStreamId, std::vector< std::pair< uint, NvMotDataTypes::Rect2f > > > m_inputRoisInBatch
 Reid input rois to crop. More...
 
std::shared_ptr< ReIDFrameTransformTexture > m_subImageCropper2
 Image cropper, may share with visual tracker in the future. More...
 
std::shared_ptr< ReIDCropScaler > m_subImageCropScaler
 Image crop scaler. Uses VPI crop scaler. More...
 
std::map< NvMOTStreamId, std::pair< float *, std::map< int, int > > > m_detObjReidFeatures
 Mapping each detected object to its reid features : {streamId, <each stream's reid features beginning address, {detInd : pointer to each detection}> }. More...
 
std::map< NvMOTStreamId, std::map< int, int > > m_featureIndFrameNumMap
 Frame number of each gallery reid feature, keyed by stream and global feature index. More...
 
int m_inputInd
 The index of pointer to input tensor. More...
 
int m_outputInd
 The index of pointer to output tensor. More...
 
float * m_reidFeaturesDet_d
 
float * m_reidFeaturesDet_h
 Output features in a batch from reid network. More...
 
float * m_inputBuf_d
 
float * m_inputBuf_h
 Input patches to reid network. More...
 
std::vector< void * > m_bindings
 Pointers to TensorRT tensors. More...
 
cudaStream_t m_cuStream
 Cuda stream to run all GPU tasks. More...
 
int m_maxReidProductSizePerStream
 Max reid CUDA mat size for each stream. More...
 
float * m_reidProduct_d
 
float * m_reidProduct_h
 Dot products between detection and gallery reid features of each stream. More...
 
int * m_targetReidFeatureInds_d
 
int * m_targetReidFeatureInds_h
 Tracked objects' list of re-id feature gallery inds, size: m_maxTargetsToTrack x m_reidHistorySize. More...
 
int2 * m_reidProductSize_d
 
int2 * m_reidProductSize_h
 Actual number of re-id products in each stream; x: NumOfFeaturesInGalleryThisStream, y: numOfDetThisStream. More...
 
int * m_targetWork_1_d
 
int * m_targetWork_1_h
 Work space storing each target's info, size: m_maxTargetsToTrack. More...
 
int * m_targetWork_2_d
 
int * m_targetWork_2_h
 Work space storing each target's info, size: m_maxTargetsToTrack. More...
 
int * m_targetWork_3_d
 
int * m_targetWork_3_h
 Work space storing each target's info, size: m_maxTargetsToTrack. More...
 
float * m_confidenceReidDetTargets_d
 
float * m_confidenceReidDetTargets_h
 Re-id similarity between each target and detection after taking nearest neighbors, size: m_maxTargetsToTrack x maxDetsPerStream. More...
 
float4 * m_inputRoisInBatch_d
 
float4 * m_inputRoisInBatch_h
 Reid input rois to crop stored in a continuous array. More...
 
int * m_targetInds4Rois_d
 
int * m_targetInds4Rois_h
 Target ind for each roi input. More...
 
int * m_nearestIndReidDetTargets_d
 
int * m_nearestIndReidDetTargets_h
 Targets' nearest neighbor index in reid features. More...
 
int m_normFeatureCudaBlockSize
 Cuda block size for reid feature normalization. More...
 
cublasHandle_t m_cublasHandle
 Cublas handle. More...
 
std::shared_ptr< NvTrackerMultiThreadWorker< DisMahalanobisIn > > m_disMahaThreadWorker
 Mahalanobis distance thread. More...
 

Constructor & Destructor Documentation

◆ ReID() [1/4]

ReID::ReID ( const std::string &  configFilePath)

Construct a ReID instance from configuration.

Parameters
[in]configFilePathPath to the tracker configuration file.

◆ ReID() [2/4]

ReID::ReID ( const std::string &  configFilePath,
const std::string &  modelName,
const bool  calDisMaha = true 
)

Construct a ReID instance from configuration.

Parameters
[in]configFilePathPath to the tracker configuration file.
[in]modelNameConfigured model name.
[in]calDisMahaIf Mahalanobis distance needs to be computed.

◆ ~ReID() [1/2]

virtual ReID::~ReID ( )
virtual

Release resources owned by the ReID instance.

◆ ReID() [3/4]

ReID::ReID ( const std::string &  configFilePath)

Construct a ReID instance from configuration.

Parameters
[in]configFilePathPath to the tracker configuration file.

◆ ReID() [4/4]

ReID::ReID ( const std::string &  configFilePath,
const std::string &  modelName,
const bool  calDisMaha = true 
)

Construct a ReID instance from configuration.

Parameters
[in]configFilePathPath to the tracker configuration file.
[in]modelNameConfigured model name.
[in]calDisMahaIf Mahalanobis distance needs to be computed.

◆ ~ReID() [2/2]

virtual ReID::~ReID ( )
virtual

Release resources owned by the ReID instance.

Member Function Documentation

◆ computeMahalanobisDist() [1/2]

void ReID::computeMahalanobisDist ( DisMahalanobisIn  in)
protected

Compute Mahalanobis distance for NvDeepSORT tracker.

Parameters
[in]inInput to compute Mahalanobis distance.

◆ computeMahalanobisDist() [2/2]

void ReID::computeMahalanobisDist ( DisMahalanobisIn  in)
protected

Compute Mahalanobis distance for NvDeepSORT tracker.

Parameters
[in]inInput to compute Mahalanobis distance.

◆ computeReIDFeatureDist() [1/2]

void ReID::computeReIDFeatureDist ( const std::map< NvMOTStreamId, NvMOTFrame * > &  inputMeta)
protected

Compute reid feature distance between detection and trackers.

Parameters
[in]inputMetaInput frames keyed by stream ID.

◆ computeReIDFeatureDist() [2/2]

void ReID::computeReIDFeatureDist ( const std::map< NvMOTStreamId, NvMOTFrame * > &  inputMeta)
protected

Compute reid feature distance between detection and trackers.

Parameters
[in]inputMetaInput frames keyed by stream ID.

◆ doInference() [1/2]

void ReID::doInference ( const std::map< NvMOTStreamId, NvMOTFrame * > &  inputMeta,
std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &  detectedObjects,
const bool  isForReAssoc 
)
overridevirtual

Extract ReID features from input images and save them in m_reidFeaturesDet_d.

Parameters
[in]inputMetaA batch of input frames.
[in,out]detectedObjectsNewly detected objects in each stream.
[in]isForReAssocWhether this inference is for reassociation.

Implements IReID.

◆ doInference() [2/2]

void ReID::doInference ( const std::map< NvMOTStreamId, NvMOTFrame * > &  inputMeta,
std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &  detectedObjects,
const bool  isForReAssoc 
)
overridevirtual

Extract ReID features from input images and save them in m_reidFeaturesDet_d.

Parameters
[in]inputMetaA batch of input frames.
[in,out]detectedObjectsNewly detected objects in each stream.
[in]isForReAssocWhether this inference is for reassociation.

Implements IReID.

◆ extractImagePatchesBatch() [1/2]

void ReID::extractImagePatchesBatch ( const std::map< NvMOTStreamId, NvMOTFrame * > &  inputMeta,
std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &  detectedObjects 
)
protected

Crop input frames using detected bboxes and rescale them as ReID network input size.

Parameters
[in]inputMetaInput frames keyed by stream ID.
[in]detectedObjectsNewly detected objects in each stream.

◆ extractImagePatchesBatch() [2/2]

void ReID::extractImagePatchesBatch ( const std::map< NvMOTStreamId, NvMOTFrame * > &  inputMeta,
std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &  detectedObjects 
)
protected

Crop input frames using detected bboxes and rescale them as ReID network input size.

Parameters
[in]inputMetaInput frames keyed by stream ID.
[in]detectedObjectsNewly detected objects in each stream.

◆ generateImagePatchesWithSegmentationMask() [1/2]

void ReID::generateImagePatchesWithSegmentationMask ( std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &  detectedObjects)
protected

Multiply segmentation mask with image patches for ReID input.

Parameters
[in,out]detectedObjectsNewly detected objects in each stream.

◆ generateImagePatchesWithSegmentationMask() [2/2]

void ReID::generateImagePatchesWithSegmentationMask ( std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &  detectedObjects)
protected

Multiply segmentation mask with image patches for ReID input.

Parameters
[in,out]detectedObjectsNewly detected objects in each stream.

◆ getFeatures2Host() [1/2]

void ReID::getFeatures2Host ( )

Copy ReID features from device memory to host memory.

◆ getFeatures2Host() [2/2]

void ReID::getFeatures2Host ( )

Copy ReID features from device memory to host memory.

◆ getReIDType() [1/2]

const REID_TYPES ReID::getReIDType ( )
inlineoverridevirtual

Get the configured ReID implementation type.

Implements IReID.

Definition at line 206 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

References m_params, and ReIDConfigParams::m_reidType.

◆ getReIDType() [2/2]

const REID_TYPES ReID::getReIDType ( )
inlineoverridevirtual

Get the configured ReID implementation type.

Implements IReID.

Definition at line 206 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

References m_params, and ReIDConfigParams::m_reidType.

◆ initializeModel() [1/2]

void ReID::initializeModel ( )
overridevirtual

Create TensorRT inference engine; if engine does not exist, serialize from model file.

Implements IReID.

◆ initializeModel() [2/2]

void ReID::initializeModel ( )
overridevirtual

Create TensorRT inference engine; if engine does not exist, serialize from model file.

Implements IReID.

◆ initializeRuntime() [1/2]

void ReID::initializeRuntime ( const SourceFrameInfo &  frameInfo,
const uint  maxTargetsPerStream,
const std::shared_ptr< NvTrackedObjectManager > &  targetManager 
)
overridevirtual

Initialize variables and allocate memories.

Parameters
[in]frameInfoMetadata about the source image, such as size and color.
[in]maxTargetsPerStreamMaximum number of targets to track in each stream.
[in]targetManagerTarget manager of the tracked objects.

Implements IReID.

◆ initializeRuntime() [2/2]

void ReID::initializeRuntime ( const SourceFrameInfo &  frameInfo,
const uint  maxTargetsPerStream,
const std::shared_ptr< NvTrackedObjectManager > &  targetManager 
)
overridevirtual

Initialize variables and allocate memories.

Parameters
[in]frameInfoMetadata about the source image, such as size and color.
[in]maxTargetsPerStreamMaximum number of targets to track in each stream.
[in]targetManagerTarget manager of the tracked objects.

Implements IReID.

◆ isModelInitialized() [1/2]

bool ReID::isModelInitialized ( )
inlineoverridevirtual

Report whether the inference model is initialized.

Implements IReID.

Definition at line 200 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

References m_isModelInit.

◆ isModelInitialized() [2/2]

bool ReID::isModelInitialized ( )
inlineoverridevirtual

Report whether the inference model is initialized.

Implements IReID.

Definition at line 200 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

References m_isModelInit.

◆ isRuntimeInitialized() [1/2]

bool ReID::isRuntimeInitialized ( )
inlineoverridevirtual

Report whether runtime resources are initialized.

Implements IReID.

Definition at line 203 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

References m_isRuntimeInit.

◆ isRuntimeInitialized() [2/2]

bool ReID::isRuntimeInitialized ( )
inlineoverridevirtual

Report whether runtime resources are initialized.

Implements IReID.

Definition at line 203 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

References m_isRuntimeInit.

◆ multiplyReIDFeatures() [1/2]

void ReID::multiplyReIDFeatures ( const int  streamInd,
const NvMOTStreamId  videoStreamId 
)
protected

Compute dot products between detection and gallery ReID features.

Parameters
[in]streamIndIndex of this stream in the current input batch.
[in]videoStreamIdVideo stream identifier.

◆ multiplyReIDFeatures() [2/2]

void ReID::multiplyReIDFeatures ( const int  streamInd,
const NvMOTStreamId  videoStreamId 
)
protected

Compute dot products between detection and gallery ReID features.

Parameters
[in]streamIndIndex of this stream in the current input batch.
[in]videoStreamIdVideo stream identifier.

◆ normalizaReIDFeatures() [1/2]

void ReID::normalizaReIDFeatures ( )
protected

Normalize ReID network output to ensure l2 norm equals to 1.

◆ normalizaReIDFeatures() [2/2]

void ReID::normalizaReIDFeatures ( )
protected

Normalize ReID network output to ensure l2 norm equals to 1.

◆ outputReIDTensor() [1/2]

void ReID::outputReIDTensor ( NvDsReidTensorBatch &  reidTensorBatch)
overridevirtual

Output the ReID tensor of a batch.

Parameters
[out]reidTensorBatchBatch reid tensor output to be filled.

Implements IReID.

◆ outputReIDTensor() [2/2]

void ReID::outputReIDTensor ( NvDsReidTensorBatch &  reidTensorBatch)
overridevirtual

Output the ReID tensor of a batch.

Parameters
[out]reidTensorBatchBatch reid tensor output to be filled.

Implements IReID.

◆ outputTargetReIDInd() [1/2]

int ReID::outputTargetReIDInd ( NvMOTStreamId  streamId,
uint  targetInd 
)
overridevirtual

Output a target's ReID vector index in the batch tensor.

Parameters
[in]streamIdStream index.
[in]targetIndThe target index.
Returns
The target's ReID vector index in the batch tensor, -1 means no reid feature.

Implements IReID.

◆ outputTargetReIDInd() [2/2]

int ReID::outputTargetReIDInd ( NvMOTStreamId  streamId,
uint  targetInd 
)
overridevirtual

Output a target's ReID vector index in the batch tensor.

Parameters
[in]streamIdStream index.
[in]targetIndThe target index.
Returns
The target's ReID vector index in the batch tensor, -1 means no reid feature.

Implements IReID.

◆ outputTargetReIDObj() [1/2]

void ReID::outputTargetReIDObj ( NvMOTStreamId  streamId,
uint  targetInd,
NvDsReidTensorBatch &  reidTensorBatch,
NvDsObjReid &  reidObj 
)
overridevirtual

Output a target's ReID vector information.

Parameters
[in]streamIdStream index.
[in]targetIndThe target index.
[in]reidTensorBatchBatch reid tensor to get the memory pointers.
[out]reidObjThe target's ReID vector memory pointers and feature size.

Implements IReID.

◆ outputTargetReIDObj() [2/2]

void ReID::outputTargetReIDObj ( NvMOTStreamId  streamId,
uint  targetInd,
NvDsReidTensorBatch &  reidTensorBatch,
NvDsObjReid &  reidObj 
)
overridevirtual

Output a target's ReID vector information.

Parameters
[in]streamIdStream index.
[in]targetIndThe target index.
[in]reidTensorBatchBatch reid tensor to get the memory pointers.
[out]reidObjThe target's ReID vector memory pointers and feature size.

Implements IReID.

◆ queryParams() [1/2]

void ReID::queryParams ( NvMOTQuery &  paramsQuery)
virtual

Populate the capabilities reported to the tracker.

Parameters
[out]paramsQueryThe output query parameters.

Implements IReID.

◆ queryParams() [2/2]

void ReID::queryParams ( NvMOTQuery &  paramsQuery)
virtual

Populate the capabilities reported to the tracker.

Parameters
[out]paramsQueryThe output query parameters.

Implements IReID.

◆ removeStream() [1/2]

void ReID::removeStream ( const NvMOTStreamId  videoStreamId)
overridevirtual

Remove a stream's reid features.

Parameters
[in]videoStreamIdVideo stream id.

Implements IReID.

◆ removeStream() [2/2]

void ReID::removeStream ( const NvMOTStreamId  videoStreamId)
overridevirtual

Remove a stream's reid features.

Parameters
[in]videoStreamIdVideo stream id.

Implements IReID.

◆ removeTrackerReIDFeature() [1/2]

void ReID::removeTrackerReIDFeature ( const NvMOTStreamId  videoStreamId,
const std::shared_ptr< NvTrackedObject >  target 
)
protected

Removed a target's all reid features.

Parameters
[in]videoStreamIdVideo stream id.
[in]targetTracker associated with the detection.

◆ removeTrackerReIDFeature() [2/2]

void ReID::removeTrackerReIDFeature ( const NvMOTStreamId  videoStreamId,
const std::shared_ptr< NvTrackedObject >  target 
)
protected

Removed a target's all reid features.

Parameters
[in]videoStreamIdVideo stream id.
[in]targetTracker associated with the detection.

◆ update() [1/2]

void ReID::update ( )
overridevirtual

Update ReID feature gallery after data association.

Implements IReID.

◆ update() [2/2]

void ReID::update ( )
overridevirtual

Update ReID feature gallery after data association.

Implements IReID.

Field Documentation

◆ m_bindings

std::vector< void * > ReID::m_bindings
protected

Pointers to TensorRT tensors.

Definition at line 238 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_calDisMaha

bool ReID::m_calDisMaha
protected

If the module needs to compute Mahalanobis distance.

Definition at line 221 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_confidenceReidDetTargets_d

float * ReID::m_confidenceReidDetTargets_d
protected

◆ m_confidenceReidDetTargets_h

float * ReID::m_confidenceReidDetTargets_h
protected

Re-id similarity between each target and detection after taking nearest neighbors, size: m_maxTargetsToTrack x maxDetsPerStream.

Definition at line 249 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_cublasHandle

cublasHandle_t ReID::m_cublasHandle
protected

Cublas handle.

Definition at line 254 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_cuStream

cudaStream_t ReID::m_cuStream
protected

Cuda stream to run all GPU tasks.

Definition at line 239 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_detObjReidFeatures

std::map< NvMOTStreamId, std::pair< float *, std::map< int, int > > > ReID::m_detObjReidFeatures
protected

Mapping each detected object to its reid features : {streamId, <each stream's reid features beginning address, {detInd : pointer to each detection}> }.

Definition at line 230 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_disMahaThreadWorker

std::shared_ptr< NvTrackerMultiThreadWorker< DisMahalanobisIn > > ReID::m_disMahaThreadWorker
protected

Mahalanobis distance thread.

Definition at line 257 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_featureIndFrameNumMap

std::map< NvMOTStreamId, std::map< int, int > > ReID::m_featureIndFrameNumMap
protected

Frame number of each gallery reid feature, keyed by stream and global feature index.

Definition at line 231 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_inference

TrtModule ReID::m_inference
protected

TensorRT module that runs the reid network.

Definition at line 212 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_inputBuf_d

float * ReID::m_inputBuf_d
protected

◆ m_inputBuf_h

float * ReID::m_inputBuf_h
protected

Input patches to reid network.

Definition at line 237 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_inputInd

int ReID::m_inputInd
protected

The index of pointer to input tensor.

Definition at line 234 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_inputRoisInBatch

std::map< NvMOTStreamId, std::vector< std::pair< uint, NvMotDataTypes::Rect2f > > > ReID::m_inputRoisInBatch
protected

Reid input rois to crop.

Definition at line 227 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_inputRoisInBatch_d

float4 * ReID::m_inputRoisInBatch_d
protected

◆ m_inputRoisInBatch_h

float4 * ReID::m_inputRoisInBatch_h
protected

Reid input rois to crop stored in a continuous array.

Definition at line 250 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_isModelInit

bool ReID::m_isModelInit
protected

Reid status if reid model initialized.

Definition at line 209 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

Referenced by isModelInitialized().

◆ m_isRuntimeInit

bool ReID::m_isRuntimeInit
protected

Reid status if runtime variables initialized.

Definition at line 210 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

Referenced by isRuntimeInitialized().

◆ m_maxReidProductSizePerStream

int ReID::m_maxReidProductSizePerStream
protected

Max reid CUDA mat size for each stream.

Definition at line 242 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_maxStreams

int ReID::m_maxStreams
protected

Max number of streams.

Definition at line 224 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_maxTargetsPerStream

int ReID::m_maxTargetsPerStream
protected

Max number of targets to keep per stream.

Definition at line 223 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_maxTargetsToTrack

int ReID::m_maxTargetsToTrack
protected

Max number of targets to keep for all streams.

Definition at line 222 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_nearestIndReidDetTargets_d

int * ReID::m_nearestIndReidDetTargets_d
protected

◆ m_nearestIndReidDetTargets_h

int * ReID::m_nearestIndReidDetTargets_h
protected

Targets' nearest neighbor index in reid features.

Definition at line 252 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_normFeatureCudaBlockSize

int ReID::m_normFeatureCudaBlockSize
protected

Cuda block size for reid feature normalization.

Definition at line 253 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_numBboxes

int ReID::m_numBboxes
protected

Number of detected boxes in the current batch tracker recieved.

Definition at line 225 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_outputInd

int ReID::m_outputInd
protected

The index of pointer to output tensor.

Definition at line 235 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_params

ReIDConfigParams ReID::m_params
protected

Config params for reid module.

Definition at line 211 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

Referenced by getReIDType().

◆ m_reidFeatureGallery

std::shared_ptr< ReIDFeatureGallery > ReID::m_reidFeatureGallery
protected

ReID feature gallery for target management.

Definition at line 213 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_reidFeaturesDet_d

float * ReID::m_reidFeaturesDet_d
protected

◆ m_reidFeaturesDet_h

float * ReID::m_reidFeaturesDet_h
protected

Output features in a batch from reid network.

Definition at line 236 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_reidProduct_d

float * ReID::m_reidProduct_d
protected

◆ m_reidProduct_h

float * ReID::m_reidProduct_h
protected

Dot products between detection and gallery reid features of each stream.

Definition at line 243 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_reidProductSize_d

int2 * ReID::m_reidProductSize_d
protected

◆ m_reidProductSize_h

int2 * ReID::m_reidProductSize_h
protected

Actual number of re-id products in each stream; x: NumOfFeaturesInGalleryThisStream, y: numOfDetThisStream.

Definition at line 245 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_srcImageSize

NvMotDataTypes::Size ReID::m_srcImageSize
protected

Tracker library frame size.

Definition at line 226 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_subImageCropper2

std::shared_ptr< ReIDFrameTransformTexture > ReID::m_subImageCropper2
protected

Image cropper, may share with visual tracker in the future.

Definition at line 228 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_subImageCropScaler

std::shared_ptr< ReIDCropScaler > ReID::m_subImageCropScaler
protected

Image crop scaler. Uses VPI crop scaler.

Definition at line 229 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_targetInds4Rois_d

int * ReID::m_targetInds4Rois_d
protected

◆ m_targetInds4Rois_h

int * ReID::m_targetInds4Rois_h
protected

Target ind for each roi input.

Definition at line 251 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_targetManager

std::shared_ptr< NvTrackedObjectManager > ReID::m_targetManager
protected

Target manager providing target status to update feature gallery.

Definition at line 214 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_targetReidFeatureInds_d

int * ReID::m_targetReidFeatureInds_d
protected

◆ m_targetReidFeatureInds_h

int * ReID::m_targetReidFeatureInds_h
protected

Tracked objects' list of re-id feature gallery inds, size: m_maxTargetsToTrack x m_reidHistorySize.

Definition at line 244 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_targetWork_1_d

int * ReID::m_targetWork_1_d
protected

◆ m_targetWork_1_h

int * ReID::m_targetWork_1_h
protected

Work space storing each target's info, size: m_maxTargetsToTrack.

Definition at line 246 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_targetWork_2_d

int * ReID::m_targetWork_2_d
protected

◆ m_targetWork_2_h

int * ReID::m_targetWork_2_h
protected

Work space storing each target's info, size: m_maxTargetsToTrack.

Definition at line 247 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.

◆ m_targetWork_3_d

int * ReID::m_targetWork_3_d
protected

◆ m_targetWork_3_h

int * ReID::m_targetWork_3_h
protected

Work space storing each target's info, size: m_maxTargetsToTrack.

Definition at line 248 of file sources/libs/nvmultiobjecttracker/include/modules/ReID/ReID.hpp.


The documentation for this class was generated from the following file: