|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
18 #ifndef REIDLIB_REIDFEATUREGALLERY_HPP_
19 #define REIDLIB_REIDFEATUREGALLERY_HPP_
24 #include "modules/utility/cuda_common.hpp"
25 #include "modules/NvMultiObjectTracker/NvMultiObjectTracker_common.hpp"
46 const int reidFeatureSize,
const int reidHistorySize,
const uint32_t maxStreams,
47 const int maxTargetsPerStream,
const int debugVerboseLevel
184 std::cout << featureInd <<
", ";
193 void dumpReIDFeatureGallery(std::string filename);
212 #endif // REIDLIB_REIDFEATUREGALLERY_HPP_
void remove(const NvMOTStreamId videoStreamId, const std::vector< int > &reidFeatureInds)
Remove reid feature of given indices.
const int getTargetReIDFeatureNextInd(uint targetInd) const
Get the next circular-history slot for a target.
int getReidFeatureIndGlobal(const NvMOTStreamId videoStreamId, uint targetInd)
For a new reid feature to add, determine its position in feature gallery and return the global index ...
const int getReIDHistorySize() const
Get the configured per-target feature history size.
~ReIDFeatureGallery()
Release resources owned by the ReIDFeatureGallery instance.
std::deque< int > m_reidFeatureOffsetsInPool
Reid feature pointers in pool when unused.
float * m_reidFeatureGallery_d
void fuseReidFeatureInd(const NvMOTStreamId videoStreamId, uint targetIndKept, uint targetIndFused)
Merge fused targets' reid features into its peer.
int m_reidFeatureSize
Size of each reid feature.
int m_reidHistorySize
Max number of reid features per object.
std::map< NvMOTStreamId, int > m_reidFeatureOffsets
Reid feature gallery indices being used by each stream, {streamID, ptr}.
void updateTargetReIDFeatureInd(uint targetInd, int featureInd)
Record a feature index for a target.
const std::vector< int > & getTargetReIDFeatureInds(uint targetInd) const
Get the gallery feature indices retained for a target.
void printFeatureInds(uint targetInd) const
Print the feature indices retained for a target.
cudaStream_t m_cuStream
CUDA stream.
std::map< uint, std::vector< int > > m_reidFeatureIndsTargets
Each target's reid feature indices.
bool m_isInit
If initialized.
void resetTargetReIDFeatureInds(uint targetInd)
Reset the feature indices retained for a target.
std::map< uint, uint > m_reidFeatureNextIndTargets
Each target's next circular-history slot for a reid feature.
void removeStream(const NvMOTStreamId videoStreamId)
Remove a stream's all reid features.
ReIDFeatureGallery()
Construct a ReIDFeatureGallery instance.
void removeStreamReIDFeature(const NvMOTStreamId videoStreamId)
Remove reid feature gallery and each target's record.
void removeTrackerReIDFeature(const NvMOTStreamId videoStreamId, const std::shared_ptr< NvTrackedObject > target)
Remove a target's reid features from the gallery.
int getReidFeatureOffset(const NvMOTStreamId videoStreamId) const
Get the global-gallery offset of a stream's partition.
std::map< NvMOTStreamId, int > m_lastInds
Index of last feature gallery being used in each stream.
float * m_reidFeatureGallery_h
CUDA array saving target features in past frames.
Detected object info obtained from input metadata.
void initialize(const int reidFeatureSize, const int reidHistorySize, const uint32_t maxStreams, const int maxTargetsPerStream, const int debugVerboseLevel)
Allocate feature-gallery storage and initialize stream partitions.
std::map< NvMOTStreamId, std::set< int > > m_reidFeatureIndsInPool
Feature gallery indices in pool.
int m_maxTargetsPerStream
Max targets per stream.
int m_debugVerboseLevel
Debug message verbose mode level.
Stores and updates per-target ReID feature histories.
const int getLastInd(const NvMOTStreamId streamId) const
Get the last feature gallery index in use for a stream.
bool updateReIDFeature(const NvMOTStreamId videoStreamId, const DetectedObjInfo *detObj, const std::shared_ptr< NvTrackedObject > target)
Update reid feature gallery and each target's record.
float * getFirstReIDFeaturePtrs()
Get the start of the complete feature gallery.
const float * getReIDFeaturePtrs(const NvMOTStreamId streamId) const
Get the device pointer to a stream's feature gallery partition.