NVIDIA DeepStream SDK API Reference

9.2 Release
cuReID Namespace Reference

Functions

void getNearestReIDSimilarity (const cudaStream_t &stream, const int numOfTargets, const int maxDetsPerStream, const int historySize, const int maxReidProductSize, const int *targetReidFeatureInds, const float *reidProduct, const int2 *reidProductSizePerStream, const int *streamInds, const int *featureIndSize, float *confidenceReidDetTargets, int *nearestIndReidDetTargets)
 Given ReID dot product score between each detection and each target's feature gallery, find nearest neighbor (highest score) for each detection and target pair. More...
 
void copyDetReIDFeatureToGallery (const cudaStream_t &stream, const int numOfTargets, const int reidFeatureSize, const int *detInds, const float *reidFeatureDet, const int *reidFeatureGalleryInds, const int *trackerDoProcessing, float *reidFeatureGallery)
 Copy detection's reid features to target's feature gallery based on data association matched pairs. More...
 
void l2NormalizeReIDFeatures (const cudaStream_t &stream, const int numOfFeatures, const int reidFeatureSize, const int blockSize, float *reidFeatureDet)
 Perform l2 normalization for ReID features. More...
 
void applySegmentaitonToImagePatches (const cudaStream_t &stream, const float *srcMaskFrameBatch, const int srcFrameWidth, const int srcFrameElementSize, const int imgWidth, const int imgElementSize, const int numOfBboxes, const int *targetInds, const float4 *srcRois, float *imgPatchBatch)
 Crop and resize segmentation mask into each ReID input patch's size. More...
 

Function Documentation

◆ applySegmentaitonToImagePatches()

void cuReID::applySegmentaitonToImagePatches ( const cudaStream_t &  stream,
const float *  srcMaskFrameBatch,
const int  srcFrameWidth,
const int  srcFrameElementSize,
const int  imgWidth,
const int  imgElementSize,
const int  numOfBboxes,
const int *  targetInds,
const float4 *  srcRois,
float *  imgPatchBatch 
)

Crop and resize segmentation mask into each ReID input patch's size.

Parameters
[in]streamCUDA stream used for the operation.
[in]srcMaskFrameBatchSource segmentation masks for all targets.
[in]srcFrameWidthWidth of each source mask in pixels.
[in]srcFrameElementSizeNumber of elements in each source mask.
[in]imgWidthWidth of each destination image patch in pixels.
[in]imgElementSizeNumber of pixels in each destination image patch.
[in]numOfBboxesNumber of image patches to process.
[in]targetIndsSource-mask target index for each image patch.
[in]srcRoisSource region of interest for each image patch.
[in,out]imgPatchBatchImage patches masked in place.

◆ copyDetReIDFeatureToGallery()

void cuReID::copyDetReIDFeatureToGallery ( const cudaStream_t &  stream,
const int  numOfTargets,
const int  reidFeatureSize,
const int *  detInds,
const float *  reidFeatureDet,
const int *  reidFeatureGalleryInds,
const int *  trackerDoProcessing,
float *  reidFeatureGallery 
)

Copy detection's reid features to target's feature gallery based on data association matched pairs.

Parameters
[in]streamCUDA stream used for the operation.
[in]numOfTargetsNumber of tracked targets to process.
[in]reidFeatureSizeNumber of values in each ReID feature vector.
[in]detIndsMatched detection index for each target.
[in]reidFeatureDetDetection feature vectors.
[in]reidFeatureGalleryIndsDestination gallery index for each target.
[in]trackerDoProcessingProcessing-enable flag for each target.
[in,out]reidFeatureGalleryGallery receiving the matched detection features.

◆ getNearestReIDSimilarity()

void cuReID::getNearestReIDSimilarity ( const cudaStream_t &  stream,
const int  numOfTargets,
const int  maxDetsPerStream,
const int  historySize,
const int  maxReidProductSize,
const int *  targetReidFeatureInds,
const float *  reidProduct,
const int2 *  reidProductSizePerStream,
const int *  streamInds,
const int *  featureIndSize,
float *  confidenceReidDetTargets,
int *  nearestIndReidDetTargets 
)

Given ReID dot product score between each detection and each target's feature gallery, find nearest neighbor (highest score) for each detection and target pair.

Parameters
[in]streamCUDA stream used for the operation.
[in]numOfTargetsActual number of targets now.
[in]maxDetsPerStreamMaximum number of detections in one stream.
[in]historySizeMaximum number of gallery features retained per target.
[in]maxReidProductSizeMax number of reid dot product elements per stream := maxNumofDet x maxFeatGallerySize.
[in]targetReidFeatureIndsFeature gallery indices for all targets := numOfTargets x historySize.
[in]reidProductReid dot product elements for all streams := numOfStreams x numOfDet x featGallerySize.
[in]reidProductSizePerStreamActual number of features in gallery and detection features for each stream. x: featureGallerySizeThisStream, y: numOfDetThisStream.
[in]streamIndsStream index for each target to find detected features and feature gallery for that stream.
[in]featureIndSizeNumber of retained gallery features for each target.
[out]confidenceReidDetTargetsSimilarity score between each det and target after finding nearest neighbor.
[out]nearestIndReidDetTargetsGallery index of the nearest history feature for each target and detection.

◆ l2NormalizeReIDFeatures()

void cuReID::l2NormalizeReIDFeatures ( const cudaStream_t &  stream,
const int  numOfFeatures,
const int  reidFeatureSize,
const int  blockSize,
float *  reidFeatureDet 
)

Perform l2 normalization for ReID features.

Parameters
[in]streamCUDA stream used for the operation.
[in]numOfFeaturesNumber of feature vectors to normalize.
[in]reidFeatureSizeNumber of values in each ReID feature vector.
[in]blockSizeNumber of CUDA threads requested per feature vector.
[in,out]reidFeatureDetFeature vectors normalized in place.