Copyright (c) 2019-2023, NVIDIA CORPORATION.
All rights reserved.
NVIDIA Corporation and its licensors retain all intellectual property and proprietary rights in and to this software, related documentation and any modifications thereto. Any use, reproduction, disclosure or distribution of this software and related documentation without an express license agreement from NVIDIA Corporation is strictly prohibited. Tracker process class.
Definition at line 29 of file nvtracker_proc.h.
Data Structures | |
struct | ClassInfo |
Object class information. More... | |
struct | DispatchInfo |
Info corresponding to each sub-batch thread. More... | |
struct | DispatchReq |
Per-sub-batch dispatch to low-level tracker lib. More... | |
struct | ProcParams |
Tracker data submitted for proceeding. More... | |
Public Member Functions | |
NvTrackerProc () | |
virtual | ~NvTrackerProc () |
virtual bool | init (const TrackerConfig &config) |
virtual void | deInit () |
virtual bool | addSource (uint32_t sourceId) |
Tracker actions when a source is added to the pipeline. More... | |
virtual bool | removeSource (uint32_t sourceId, bool removeObjectIdMapping=true) |
Tracker actions when a source is removed to the pipeline. More... | |
virtual bool | resetSource (uint32_t sourceId) |
Tracker actions when a source is reset. More... | |
virtual bool | submitInput (const InputParams &inputParams) |
Submit an input batch to tracker process queue. More... | |
virtual CompletionStatus | waitForCompletion (InputParams &inputParams) |
Wait until a batch's process is done. More... | |
virtual bool | flushReqs () |
Flush the request to send the batch downstream. More... | |
Protected Types | |
typedef uint32_t | BatchId |
Current batch ID. More... | |
typedef uint64_t | SurfaceStreamId |
Composition of unique ID for each surface from each source Some sources (e.g. More... | |
typedef uint32_t | StreamId |
Source stream ID. More... | |
typedef uint32_t | SurfaceId |
Surface type ID. More... | |
typedef uint32_t | SubBatchId |
Sub batch ID. More... | |
Protected Member Functions | |
void | processSubBatch (DispatchInfo *pDispatchInfo) |
Function to pop sub-batch from queue, call low level lib to process and update meta data with tracking results for the sub-batch. More... | |
bool | dispatchSubBatches (ProcParams procParams) |
Function to create sub-batches from a batch and submit to corresponding sub-batch queues. More... | |
NvMOTContextHandle | initTrackerContext (uint32_t sbId=0) |
Internal initializing and release function. More... | |
bool | initConvBufPool () |
Initialize surface transform buffer pool. More... | |
void | deInitConvBufPool () |
Deinitialize surface transform buffer pool. More... | |
bool | initMiscDataPool () |
Initialize misc data (user meta) buffer pool. More... | |
void | deInitMiscDataPool () |
Deinitialize misc data (user meta) buffer pool. More... | |
bool | initTrackerLib () |
Initialize low-level tracker lib. More... | |
void | deInitTrackerLib () |
Deinitialize low-level tracker lib. More... | |
void | allocateProcessMemory (NvMOTProcessParams &procInput, NvMOTTrackedObjBatch &procResult) |
Allocate memory for low level library input. More... | |
void | allocateProcessMemory (NvMOTProcessParams &procInput, NvMOTTrackedObjBatch &procResult, uint32_t batchSize) |
void | releaseProcessMemory (NvMOTProcessParams &procInput, NvMOTTrackedObjBatch &procResult) |
Release input memory. More... | |
void | releaseProcessMemory (NvMOTProcessParams &procInput, NvMOTTrackedObjBatch &procResult, uint32_t batchSize) |
void | allocateConvexHullMemory (NvMOTTrackedObj *list, const uint32_t numAllocated) |
void | releaseConvexHullMemory (NvMOTTrackedObj *list, const uint32_t numAllocated) |
void | queueFrames (const NvDsBatchMeta &batchMeta, std::vector< std::map< SurfaceStreamId, NvDsFrameMeta * >> &batchList) |
Functions to process a batch. More... | |
void | fillMOTFrame (SurfaceStreamId ssId, const ProcParams &procParams, const NvDsFrameMeta &frameMeta, NvMOTFrame &motFrame, NvMOTTrackedObjList &trackedObjList) |
Fill input to low-level tracker lib. More... | |
void | updateBatchMeta (const NvMOTTrackedObjBatch &procResult, const ProcParams &procParams, std::map< SurfaceStreamId, NvDsFrameMeta * > &frameMap) |
Update batch meta with tracking results. More... | |
void | updateFrameMeta (NvDsFrameMeta *pFrameMeta, const NvMOTTrackedObjList &objList, const ProcParams &procParams) |
Update each stream's frame meta with tracking results. More... | |
void | updatePastFrameMeta (const std::vector< std::map< SurfaceStreamId, NvDsFrameMeta * >> &batchList, GstNvTrackerMiscDataObject *pGstObj, ProcParams &procParams) |
Update past frame data. More... | |
void | updateUserMeta (const std::vector< std::map< SurfaceStreamId, NvDsFrameMeta * >> &batchList, ProcParams &procParams, NvTrackerMiscDataBuffer *pMiscDataBuf) |
Update tracker user meta. More... | |
void | updateUserMeta (const std::vector< std::map< SurfaceStreamId, NvDsFrameMeta * >> &batchList, ProcParams &procParams, NvTrackerMiscDataBuffer *pMiscDataBuf, TrackerMiscDataManager &miscDataMgr) |
void | updateObjectReidMeta (NvDsObjectMeta *pObjectMeta, NvMOTTrackedObj *pTrackedObj, NvDsBatchMeta *pBatchMeta) |
Update each object's reid meta. More... | |
void | updateBatchReidMeta (GstNvTrackerMiscDataObject *pGstObj, ProcParams &procParams) |
Update batch reid meta. More... | |
void | updateObjectProjectionMeta (NvDsObjectMeta *pObjectMeta, NvMOTTrackedObj *pTrackedObj, NvDsBatchMeta *pBatchMeta, float scaleWidth, float scaleHeight) |
Update each object's model projection meta. More... | |
void | updateTerminatedTrackMeta (GstNvTrackerMiscDataObject *pGstObj, ProcParams &procParams) |
void | updateShadowTrackMeta (GstNvTrackerMiscDataObject *pGstObj, ProcParams &procParams) |
void | processBatch () |
Function to pop batch from input queue, call low level lib to process and update meta data with tracking results. More... | |
SurfaceStreamId | getSurfaceStreamId (StreamId streamId, SurfaceId surfaceId) |
Getter. More... | |
StreamId | getStreamId (SurfaceStreamId ssId) |
SurfaceId | getSurfaceId (SurfaceStreamId ssId) |
guint64 | objectIdMapping (const guint64 &objectId, const SurfaceStreamId &ssId) |
Object ID mapper to ensure ID starts from 0 after reset. More... | |
void | removeUntrackedObjects (NvDsFrameMeta *pFrameMeta) |
Remove objects that don't need an ID. More... | |
bool | clipBBox (uint32_t frameWidth, uint32_t frameHeight, float &left, float &top, float &width, float &height) |
Clip the bbox to be within the frame. More... | |
NvDsTargetMiscDataBatch * | allocatePastFrameMemory () |
Protected Attributes | |
std::map< int, ClassInfo > | m_ClassInfoMap |
Info mapped per class. More... | |
TrackerConfig | m_Config |
Tracker processing config. More... | |
bool | m_Running = false |
Tracker lib is running. More... | |
std::atomic< bool > | m_TrackerLibError |
Tracker lib encounters an error. More... | |
ConvBufManager | m_ConvBufMgr |
Buffer manager for surface transformation. More... | |
TrackerMiscDataManager | m_MiscDataMgr |
Buffer manager for misc data (user meta). More... | |
std::queue< ProcParams > | m_ProcQueue |
Input queue waiting for tracker proceeding. More... | |
std::mutex | m_ProcQueueLock |
std::condition_variable | m_ProcQueueCond |
std::condition_variable | m_BufQueueCond |
std::map< BatchId, std::vector< SubBatchId > > | m_PendingBatch |
Stores batches not finishing tracker proceeding. More... | |
BatchId | m_BatchId = 0 |
std::mutex | m_PendingBatchLock |
std::map< BatchId, bool > | m_ConvBufComplete |
Stores status of pending batches for buffer conversion. More... | |
std::mutex | m_ConvBufLock |
NvMOTContextHandle | m_BatchContextHandle = nullptr |
Batch dispatch to low-level tracker lib. More... | |
std::thread | m_ProcessBatchThread |
std::map< SubBatchId, DispatchInfo > | m_DispatchMap |
Mapping fron sub-batch id to corresponding thread info. More... | |
std::mutex | m_DispatchMapLock |
std::map< SurfaceStreamId, SubBatchId > | m_SsidSubBatchMap |
Mapping for streamID => SubBatchId. More... | |
std::map< uint32_t, uint32_t > | m_PadIndexSeqIndexMap |
Pad index(Source id) mapping: {Pad index(source id): sequence index in the sub-batch}. More... | |
std::queue< InputParams > | m_CompletionQueue |
Completions. More... | |
std::mutex | m_CompletionQueueLock |
std::condition_variable | m_CompletionQueueCond |
std::map< SurfaceStreamId, guint64 > | m_ObjectIdOffsetMap |
Object id mapping: {surface stream ID: object id offset}. More... | |
void * | m_TrackerLibHandle |
Low-level tracker lib API and support functions. More... | |
NvMOTStatus(* | m_TrackerLibInit )(NvMOTConfig *pConfigIn, NvMOTContextHandle *pContextHandle, NvMOTConfigResponse *pConfigResponse) |
Tracker low level library functions. More... | |
void(* | m_TrackerLibDeInit )(NvMOTContextHandle contextHandle) |
Low level lib deinit. More... | |
NvMOTStatus(* | m_TrackerLibProcess )(NvMOTContextHandle contextHandle, NvMOTProcessParams *pParams, NvMOTTrackedObjBatch *pTrackedObjectsBatch) |
Low level lib process. More... | |
NvMOTStatus(* | m_TrackerLibRetrieveMiscData )(NvMOTContextHandle contextHandle, NvMOTProcessParams *pParams, NvMOTTrackerMiscData *pTrackerMiscData) |
Low level lib process past frame. More... | |
NvMOTStatus(* | m_TrackerLibQuery )(uint16_t customConfigFilePathSize, char *pCustomConfigFilePath, NvMOTQuery *pQuery) |
Low level lib query. More... | |
NvMOTStatus(* | m_TrackerLibRemoveStreams )(NvMOTContextHandle contextHandle, NvMOTStreamId streamIdMask) |
Low level lib remove streams. More... | |
|
protected |
Current batch ID.
Definition at line 66 of file nvtracker_proc.h.
|
protected |
Source stream ID.
Definition at line 73 of file nvtracker_proc.h.
|
protected |
Sub batch ID.
Definition at line 77 of file nvtracker_proc.h.
|
protected |
Surface type ID.
Definition at line 75 of file nvtracker_proc.h.
|
protected |
Composition of unique ID for each surface from each source Some sources (e.g.
360d) produce multiple surfaces per frame due to dewarping etc.
Definition at line 71 of file nvtracker_proc.h.
NvTrackerProc::NvTrackerProc | ( | ) |
|
virtual |
|
virtual |
Tracker actions when a source is added to the pipeline.
Implements INvTrackerProc.
|
protected |
|
protected |
|
protected |
Allocate memory for low level library input.
|
protected |
|
protected |
Clip the bbox to be within the frame.
If the bbox is entirely outside, or shrinks to 0 in either dimension, then return false so it can be removed from the object list.
|
virtual |
Implements INvTrackerProc.
|
protected |
Deinitialize surface transform buffer pool.
|
protected |
Deinitialize misc data (user meta) buffer pool.
|
protected |
Deinitialize low-level tracker lib.
|
protected |
Function to create sub-batches from a batch and submit to corresponding sub-batch queues.
|
protected |
Fill input to low-level tracker lib.
|
virtual |
Flush the request to send the batch downstream.
Implements INvTrackerProc.
|
inlineprotected |
Definition at line 264 of file nvtracker_proc.h.
|
inlineprotected |
Definition at line 265 of file nvtracker_proc.h.
|
inlineprotected |
Getter.
Definition at line 262 of file nvtracker_proc.h.
|
virtual |
Implements INvTrackerProc.
|
protected |
Initialize surface transform buffer pool.
|
protected |
Initialize misc data (user meta) buffer pool.
|
protected |
Internal initializing and release function.
initialize the batch context with low-level tracker lib.
|
protected |
Initialize low-level tracker lib.
|
protected |
Object ID mapper to ensure ID starts from 0 after reset.
|
protected |
Function to pop batch from input queue, call low level lib to process and update meta data with tracking results.
|
protected |
Function to pop sub-batch from queue, call low level lib to process and update meta data with tracking results for the sub-batch.
|
protected |
Functions to process a batch.
In case the batch contains two frames with the same ssId, sort the frames based on frameNum in ascending order.
|
protected |
|
protected |
Release input memory.
|
protected |
|
virtual |
Tracker actions when a source is removed to the pipeline.
Implements INvTrackerProc.
|
protected |
Remove objects that don't need an ID.
|
virtual |
Tracker actions when a source is reset.
Implements INvTrackerProc.
|
virtual |
Submit an input batch to tracker process queue.
Implements INvTrackerProc.
|
protected |
Update batch meta with tracking results.
|
protected |
Update batch reid meta.
|
protected |
Update each stream's frame meta with tracking results.
|
protected |
Update each object's model projection meta.
|
protected |
Update each object's reid meta.
|
protected |
Update past frame data.
|
protected |
|
protected |
|
protected |
Update tracker user meta.
|
protected |
|
virtual |
Wait until a batch's process is done.
Implements INvTrackerProc.
|
protected |
Batch dispatch to low-level tracker lib.
Definition at line 117 of file nvtracker_proc.h.
|
protected |
Definition at line 109 of file nvtracker_proc.h.
|
protected |
Definition at line 105 of file nvtracker_proc.h.
|
protected |
|
protected |
Completions.
Definition at line 168 of file nvtracker_proc.h.
|
protected |
Definition at line 170 of file nvtracker_proc.h.
|
protected |
Definition at line 169 of file nvtracker_proc.h.
|
protected |
Tracker processing config.
Definition at line 79 of file nvtracker_proc.h.
|
protected |
Stores status of pending batches for buffer conversion.
Definition at line 113 of file nvtracker_proc.h.
|
protected |
Definition at line 114 of file nvtracker_proc.h.
|
protected |
Buffer manager for surface transformation.
Definition at line 86 of file nvtracker_proc.h.
|
protected |
Mapping fron sub-batch id to corresponding thread info.
Definition at line 153 of file nvtracker_proc.h.
|
protected |
Definition at line 154 of file nvtracker_proc.h.
|
protected |
Buffer manager for misc data (user meta).
Definition at line 89 of file nvtracker_proc.h.
|
protected |
Object id mapping: {surface stream ID: object id offset}.
Definition at line 173 of file nvtracker_proc.h.
|
protected |
Pad index(Source id) mapping: {Pad index(source id): sequence index in the sub-batch}.
Definition at line 158 of file nvtracker_proc.h.
|
protected |
Stores batches not finishing tracker proceeding.
Definition at line 108 of file nvtracker_proc.h.
|
protected |
Definition at line 110 of file nvtracker_proc.h.
|
protected |
Definition at line 118 of file nvtracker_proc.h.
|
protected |
Input queue waiting for tracker proceeding.
Definition at line 102 of file nvtracker_proc.h.
|
protected |
Definition at line 104 of file nvtracker_proc.h.
|
protected |
Definition at line 103 of file nvtracker_proc.h.
|
protected |
Tracker lib is running.
Definition at line 81 of file nvtracker_proc.h.
|
protected |
Mapping for streamID => SubBatchId.
Definition at line 156 of file nvtracker_proc.h.
|
protected |
Low level lib deinit.
Definition at line 283 of file nvtracker_proc.h.
|
protected |
Tracker lib encounters an error.
Definition at line 83 of file nvtracker_proc.h.
|
protected |
Low-level tracker lib API and support functions.
Definition at line 176 of file nvtracker_proc.h.
|
protected |
Tracker low level library functions.
Low level lib init.
Definition at line 279 of file nvtracker_proc.h.
|
protected |
Low level lib process.
Definition at line 285 of file nvtracker_proc.h.
|
protected |
Low level lib query.
Definition at line 293 of file nvtracker_proc.h.
|
protected |
Low level lib remove streams.
Definition at line 297 of file nvtracker_proc.h.
|
protected |
Low level lib process past frame.
Definition at line 289 of file nvtracker_proc.h.