|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
18 #ifndef NVMULTIOBJECTTRACKERLIB_DATAASSOCIATOR_HPP_
19 #define NVMULTIOBJECTTRACKERLIB_DATAASSOCIATOR_HPP_
26 #include <unordered_map>
28 #include "cublas_v2.h"
29 #include "modules/NvMultiObjectTracker/NvTrackerParams.hpp"
30 #include "modules/DataAssociator/IDataAssociator.hpp"
62 void read(
const YAML::Node &fn)
override;
154 const bool useVisualTracker,
const bool useReid
228 const std::shared_ptr<NvTrackedObject> trajObj,
const DetectedObjInfo &detObj,
229 const std::vector<SimilarityParam> &similarityParamList,
const float sumCorrRespAtDetectedPt
246 std::multimap<float, std::pair<uint, int>>
sortMatching(
247 const assocDataIn_t &in,
const std::vector<std::vector<float>> &distMat
291 #endif // NVMULTIOBJECTTRACKERLIB_DATAASSOCIATOR_HPP_
@ MIN_VISUAL
Indicates that minMatchingScore4VisualSimilarity was configured.
std::vector< std::vector< float > > computeDistanceMatrix(const assocDataIn_t &in, const uint stage=0) const
Compute the association score matrix.
void dumpDataAssociationResults(const assocDataOut_t &out) const
Dump-print the data association results.
float m_minMatchingScore4Iou
Specifies the minimum IOU matching score for a candidate.
bool m_checkClassMatch
Indicates whether association requires matching object classes.
@ VISUAL_SIMILARITY
Visual similarity score.
assocDataOut_t associatePerStream_greedy(const assocDataIn_t &in, const uint stage=0)
Find the best matches between detections and existing targets.
int m_maxTargetsPerStream
Specifies the maximum number of targets to track per stream.
~DataAssociator()
Report accumulated association statistics during destruction.
float m_minMatchingScore4TentativeIouInactive
Lower IoU floor for INACTIVE Stage 3 pairs; 0 disables it.
bool m_isInit
Indicates whether the parameters have been initialized.
float weight
Specifies this score's contribution to the total score.
uint m_matchingScoreSet
Records which optional matching scores were configured.
std::atomic< uint64_t > stage2_has_dets
Counts Stage Second runs with detections.
MATCHING_SCORE_SET_STATUS
bool m_useSimpleIou4Tentative
Indicates whether tentative targets use simple IOU instead of the valid-object similarity calculation...
void read(const YAML::Node &fn) override
Update association parameters from a YAML node.
std::atomic< uint64_t > passed
Counts pairs that meet the minimum overall matching score.
void dumpAssocDistanceMatrix(const assocDataIn_t &in, std::vector< std::vector< float >> distMat) const
Dump-print the scores in the distance matrix for association.
DATA_ASSOCIATOR_TYPES m_dataAssociatorType
Selects the data-associator implementation to construct.
std::vector< std::vector< SimilarityParam > > m_similarityParamLists
Per-stage similarity parameters and weights.
std::atomic< uint64_t > stage2_pair_total
Counts target-detection pairs evaluated in Stage Second.
std::atomic< uint64_t > stage2_size_gate
Counts Stage Second pairs rejected by the size gate.
std::atomic< uint64_t > qactive_rescue_attempted
Counts QUASIACTIVE rescue attempts in Stage Second.
float m_minMatchingScore4ReidSimilarity
Specifies the minimum ReID-similarity score for a candidate.
std::atomic< uint64_t > stage2_size_rescued
Counts Stage Second pairs rescued from the size gate.
std::atomic< uint64_t > stage2_noworld_track
Counts Stage Second targets without world coordinates.
std::atomic< uint64_t > stage2_matched
Counts candidates matched in Stage Second.
@ MIN_REID
Indicates that minMatchingScore4ReidSimilarity was configured.
assocDataOut_t associatePerStream_cascaded(const assocDataIn_t &in)
Run the cascaded association algorithm.
float m_matchingScoreWeight4ReidSimilarity
Specifies the weight of ReID similarity.
float m_matchingScoreWeight4Iou
Specifies the weight of the IOU score.
@ WEIGHT_REID
Indicates that matchingScoreWeight4ReidSimilarity was configured.
float m_minMatchingScore4SizeSimilarity
Specifies the minimum bounding-box size-similarity score for a candidate.
std::atomic< uint64_t > near_04_05
Counts pairs with an overall score in the range [0.4, 0.5).
const DATA_ASSOCIATOR_TYPES getDataAssociatorType() override
Return the configured data-associator type.
DataAssociator(const std::string &configFilePath)
Construct a data associator from a configuration file.
@ WEIGHT_VISUAL
Indicates that matchingScoreWeight4VisualSimilarity was configured.
std::atomic< uint64_t > stage2_wp_gate
Counts Stage Second pairs rejected by the world-proximity gate.
DA_Stats m_da_stats
Stores association-scoring counters.
float m_maxWorldDist4PrimaryAssoc
Specifies the maximum world-space feet distance in meters for primary association; a nonpositive valu...
std::atomic< uint64_t > active_iou_hardgate
Counts ACTIVE or INACTIVE pairs rejected by the IOU hard gate.
void updateParams(const YAML::Node &fn)
Update dynamic parameters during runtime.
@ WORLD_PROXIMITY
World-space proximity score used in Stage Second.
float m_minMatchingScore4TentativeIou
Specifies the minimum IOU score for matching tentative objects.
float m_minMatchingScore4PeerAssocIou
Specifies the minimum IOU score for matching peer targets.
std::multimap< float, std::pair< uint, int > > sortMatching(const assocDataIn_t &in, const std::vector< std::vector< float >> &distMat) const
Given the distance matrix, get the sorted list of potential match pairs based on the association cost...
NvTrackerParamsAssoc()
Initialize association parameters with default values.
double m_thresholdMahalanobis
Specifies the Mahalanobis-distance threshold.
assocDataOut_t associatePerStream(const assocDataIn_t in) override
Associate detections with existing targets for one stream.
std::mutex m_similarityParamsMutex
Guards similarity parameters during reads and updates.
Provides common loading helpers for tracker configuration parameters.
bool m_useReid
Records whether ReID similarity is enabled for parameter rebuilds.
bool m_useVisualTracker
Records whether visual-tracker similarity is enabled for parameter rebuilds.
std::atomic< uint64_t > qactive_iou_hardgate
Counts QUASIACTIVE pairs rejected by the IOU hard gate.
@ IOU
Intersection over union score.
std::atomic< uint64_t > qactive_size_rescued
Counts QUASIACTIVE pairs rescued from the size gate.
ASSOCIATION_MATCHER_TYPE m_associationMatcherType
Selects the GREEDY or CASCADED matcher.
float m_tentativeDetectorConfidence
Specifies the confidence ceiling for tentative detections above the minimum detector confidence.
bool isInitialized() override
Return whether the data associator has been initialized.
std::atomic< uint64_t > stage2_no_dets
Counts Stage Second runs without detections.
@ CASCADED
Matches pairs through cascaded stages.
virtual float assocDistanceFunc(const std::shared_ptr< NvTrackedObject > trajObj, const DetectedObjInfo &detObj, const std::vector< SimilarityParam > &similarityParamList, const float sumCorrRespAtDetectedPt) const
Function to compute the association score between a detector bbox and a tracked bbox.
@ REID_SIMILARITY
Reid similarity score.
void initializeSimilarityParams(const bool useVisualTracker, const bool useReid)
Rebuild per-stage similarity parameters for the enabled features.
float m_maxWorldDist4SizeBypass
Specifies the maximum world-space distance in meters for bypassing the size gate.
float minVal
Specifies the minimum matching score, below which a pair is not matched.
std::atomic< uint64_t > near_lt04
Counts pairs below a 0.4 overall score after passing component gates.
@ SIZE_SIMILARITY
Bbox size similarity score.
bool m_usePrediction4Assoc
Indicates whether association uses predicted states instead of previous states.
std::atomic< uint64_t > stage2_eligible
Counts candidates eligible for Stage Second.
std::atomic< uint64_t > stage2_hard_world
Counts Stage Second pairs rejected by the world-distance hard gate.
TYPES type
Similarity type.
Config params for the custom distance function for the data association, including the min criteria a...
std::atomic< uint64_t > stage2_noworld_det
Counts Stage Second detections without world coordinates.
float m_maxWorldDist4QuasiactiveRescue
Specifies the maximum world-space distance in meters for QUASIACTIVE IOU rescue.
Define the interface for associating detections with tracked targets.
bool m_isInit
Indicates whether the data associator has been initialized.
float m_matchingScoreWeight4SizeSimilarity
Specifies the weight of the bounding-box size-similarity score.
float m_minMatchingScore4Overall
Specifies the minimum total matching score for a candidate.
std::atomic< uint64_t > near_ge50
Counts pairs above 0.5 but below the minimum overall matching score.
Information about the input source frames for the input frame batch.
Detected object info obtained from input metadata.
int m_debugVerboseLevel
Controls debug message verbosity.
void initialize(const SourceFrameInfo &frameInfo, const uint32_t maxTargetsPerStream, const bool useVisualTracker, const bool useReid) override
Initialize the data associator for a source stream.
NvTrackerParamsAssoc m_params
Stores parsed configuration parameters.
std::atomic< uint64_t > gate_hard
Counts pairs rejected by a class, Mahalanobis, or component-score gate.
float m_matchingScoreWeight4VisualSimilarity
Specifies the weight of visual similarity measured by the correlation-response ratio.
@ GREEDY
Matches pairs in a single greedy pass.
Input for the data association module.
assocDataOut_t associatePerStream_cascadedLegacy(const assocDataIn_t &in)
Run the legacy two-stage association algorithm.
float m_minMatchingScore4VisualSimilarity
Specifies the minimum visual-similarity score for a candidate.
Store thread-safe per-session counters for the association-scoring funnel.
std::atomic< uint64_t > total
Counts all evaluated target-detection pairs.
float m_maxWorldDist4ActiveIouRescue
Specifies the maximum world-space distance for ACTIVE or INACTIVE Stage 3 IOU rescue; zero disables i...
Output from the data association module.