Associates local targets with identities returned by a remote service.
Definition at line 94 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.


Public Member Functions | |
| ReIDService (const std::string &configFilePath) | |
| Construct a ReIDService instance from configuration. More... | |
| virtual | ~ReIDService () |
| Release resources owned by the ReIDService instance. More... | |
| void | initialize (const SourceFrameInfo &frameInfo, const uint maxTargetsPerStream, const std::shared_ptr< NvTrackedObjectManager > &targetManager) override |
| Initialize variables and allocate memories. More... | |
| void | queryParams (NvMOTQuery ¶msQuery) |
| Populate the capabilities reported to the tracker. More... | |
| void | query (const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta) override |
| Send query to reid service for all unmatched active objects. More... | |
| void | updateTargetIDs () override |
| Update target ID using remoteTargetID from reid service. More... | |
| const REID_SERVICE_TYPES | getReIDServiceType () override |
| Get the configured ReID-service implementation type. More... | |
| ReIDService (const std::string &configFilePath) | |
| Construct a ReIDService instance from configuration. More... | |
| virtual | ~ReIDService () |
| Release resources owned by the ReIDService instance. More... | |
| void | initialize (const SourceFrameInfo &frameInfo, const uint maxTargetsPerStream, const std::shared_ptr< NvTrackedObjectManager > &targetManager) override |
| Initialize variables and allocate memories. More... | |
| void | queryParams (NvMOTQuery ¶msQuery) |
| Populate the capabilities reported to the tracker. More... | |
| void | query (const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta) override |
| Send query to reid service for all unmatched active objects. More... | |
| void | updateTargetIDs () override |
| Update target ID using remoteTargetID from reid service. More... | |
| const REID_SERVICE_TYPES | getReIDServiceType () override |
| Get the configured ReID-service implementation type. More... | |
Protected Member Functions | |
| void | workerThread () |
| Process queued remote ReID requests. More... | |
| void | waitToFinish () |
| Wait until all submitted service requests have completed. More... | |
| bool | tryIDCorrection (const std::shared_ptr< NvTrackedObject > targetToBeCorrected, const std::shared_ptr< NvTrackedObject > existingTarget, TargetId associatedTargetID) |
| Apply a remote identity to a compatible local target. More... | |
| std::string | convertReidFeaturesToJson (const float *reidFeatures, int reidFeatureSize) |
| Serialize a ReID feature vector as JSON. More... | |
| std::string | send_post_request (const std::string &jsonPayload) |
| Send one synchronous HTTP POST request. More... | |
| remoteTargetInfo | parseResponseForTargetID (const std::string &response) |
| Parse a remote identity result from a service response. More... | |
| bool | appendCurlRequest (const CurlRequestTargetInfo &curlRequestInfoInput) |
| Add a request to the asynchronous CURL multi-handle. More... | |
| void | processCompletedCurlRequest (CURLMsg *msg) |
| Collect the result of a completed CURL request. More... | |
| void | workerThread () |
| Process queued remote ReID requests. More... | |
| void | waitToFinish () |
| Wait until all submitted service requests have completed. More... | |
| bool | tryIDCorrection (const std::shared_ptr< NvTrackedObject > targetToBeCorrected, const std::shared_ptr< NvTrackedObject > existingTarget, TargetId associatedTargetID) |
| Apply a remote identity to a compatible local target. More... | |
| std::string | convertReidFeaturesToJson (const float *reidFeatures, int reidFeatureSize) |
| Serialize a ReID feature vector as JSON. More... | |
| std::string | send_post_request (const std::string &jsonPayload) |
| Send one synchronous HTTP POST request. More... | |
| remoteTargetInfo | parseResponseForTargetID (const std::string &response) |
| Parse a remote identity result from a service response. More... | |
| bool | appendCurlRequest (const CurlRequestTargetInfo &curlRequestInfoInput) |
| Add a request to the asynchronous CURL multi-handle. More... | |
| void | processCompletedCurlRequest (CURLMsg *msg) |
| Collect the result of a completed CURL request. More... | |
Protected Attributes | |
| bool | m_isInit |
| Reid status if runtime variables initialized. More... | |
| ReIDServiceConfigParams | m_params |
| Config params for reid module. More... | |
| std::shared_ptr< NvTrackedObjectManager > | m_targetManager |
| Target manager of the tracked objects. More... | |
| std::map< CURL *, CurlRequestTargetInfo > | m_curlRequestInfoMap |
| Active CURL handles. More... | |
| CURLM * | m_curlMultiHandle |
| CURL multi handle. More... | |
| std::string | m_curlRequestUrl |
| CURL request URL. More... | |
| std::thread | m_workerThread |
| Worker thread. More... | |
| std::atomic< bool > | m_persistThreadRunning |
| Indicates whether the worker thread should keep running. More... | |
| std::mutex | m_inputLock |
| Lock associated with input queue. More... | |
| std::condition_variable | m_cond4In |
| Wakes the worker when the input queue receives a request. More... | |
| std::queue< CurlRequestTargetInfo > | m_inputQueue |
| Queue for input. More... | |
| std::mutex | m_outputLock |
| Lock associated with output. More... | |
| std::condition_variable | m_cond4Out |
| Wakes the caller when the worker finishes a request. More... | |
| std::queue< remoteTargetInfo > | m_outputQueue |
| Queue for output. More... | |
| std::atomic< uint32_t > | m_submittedReqCnt |
| Number of submitted tasks. More... | |
| std::atomic< uint32_t > | m_finishedReqCnt |
| Keep track of how many tasks are finished. More... | |
| std::map< NvMOTStreamId, std::map< TargetId, std::pair< TargetId, int > > > | m_idCorrectionMap |
| Target-ID corrections keyed by stream ID. More... | |
| ReIDService::ReIDService | ( | const std::string & | configFilePath | ) |
Construct a ReIDService instance from configuration.
| [in] | configFilePath | Path to the tracker configuration file. |
|
virtual |
Release resources owned by the ReIDService instance.
| ReIDService::ReIDService | ( | const std::string & | configFilePath | ) |
Construct a ReIDService instance from configuration.
| [in] | configFilePath | Path to the tracker configuration file. |
|
virtual |
Release resources owned by the ReIDService instance.
|
protected |
Add a request to the asynchronous CURL multi-handle.
| [in] | curlRequestInfoInput | Request state to append to the active CURL set. |
|
protected |
Add a request to the asynchronous CURL multi-handle.
| [in] | curlRequestInfoInput | Request state to append to the active CURL set. |
|
protected |
|
protected |
|
inlineoverridevirtual |
Get the configured ReID-service implementation type.
Implements IReIDService.
Definition at line 133 of file 9.2/sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
References m_params, and ReIDServiceConfigParams::m_reidServiceType.
|
inlineoverridevirtual |
Get the configured ReID-service implementation type.
Implements IReIDService.
Definition at line 133 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
References m_params, and ReIDServiceConfigParams::m_reidServiceType.
|
overridevirtual |
Initialize variables and allocate memories.
| [in] | frameInfo | Metadata about the source image, such as size and color. |
| [in] | maxTargetsPerStream | Maximum number of targets to track in each stream. |
| [in] | targetManager | Target manager of the tracked objects. |
Implements IReIDService.
|
overridevirtual |
Initialize variables and allocate memories.
| [in] | frameInfo | Metadata about the source image, such as size and color. |
| [in] | maxTargetsPerStream | Maximum number of targets to track in each stream. |
| [in] | targetManager | Target manager of the tracked objects. |
Implements IReIDService.
|
protected |
Parse a remote identity result from a service response.
| [in] | response | Service response text. |
|
protected |
Parse a remote identity result from a service response.
| [in] | response | Service response text. |
|
protected |
Collect the result of a completed CURL request.
| [in] | msg | Completed CURL message. |
|
protected |
Collect the result of a completed CURL request.
| [in] | msg | Completed CURL message. |
|
overridevirtual |
Send query to reid service for all unmatched active objects.
| [in] | inputMeta | Input frames keyed by stream ID. |
Implements IReIDService.
|
overridevirtual |
Send query to reid service for all unmatched active objects.
| [in] | inputMeta | Input frames keyed by stream ID. |
Implements IReIDService.
|
virtual |
Populate the capabilities reported to the tracker.
| [out] | paramsQuery | The output query parameters. |
Implements IReIDService.
|
virtual |
Populate the capabilities reported to the tracker.
| [out] | paramsQuery | The output query parameters. |
Implements IReIDService.
|
protected |
Send one synchronous HTTP POST request.
| [in] | jsonPayload | JSON request payload. |
|
protected |
Send one synchronous HTTP POST request.
| [in] | jsonPayload | JSON request payload. |
|
protected |
Apply a remote identity to a compatible local target.
| [in] | targetToBeCorrected | Target whose identity may be corrected. |
| [in] | existingTarget | Existing target associated with the remote identity. |
| [in] | associatedTargetID | Target identifier returned by the service. |
|
protected |
Apply a remote identity to a compatible local target.
| [in] | targetToBeCorrected | Target whose identity may be corrected. |
| [in] | existingTarget | Existing target associated with the remote identity. |
| [in] | associatedTargetID | Target identifier returned by the service. |
|
overridevirtual |
Update target ID using remoteTargetID from reid service.
Implements IReIDService.
|
overridevirtual |
Update target ID using remoteTargetID from reid service.
Implements IReIDService.
|
protected |
Wait until all submitted service requests have completed.
|
protected |
Wait until all submitted service requests have completed.
|
protected |
Process queued remote ReID requests.
|
protected |
Process queued remote ReID requests.
|
protected |
Wakes the worker when the input queue receives a request.
Definition at line 148 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Wakes the caller when the worker finishes a request.
Definition at line 155 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
CURL multi handle.
Definition at line 141 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Active CURL handles.
All CURL-related variables are used only by the worker thread.
Definition at line 139 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
CURL request URL.
Definition at line 142 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Keep track of how many tasks are finished.
Definition at line 160 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Target-ID corrections keyed by stream ID.
Each nested key is the target ID to correct. Value is a pair of successfully associated target ID and the number of times the target ID has been associated successfully.
Definition at line 166 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Lock associated with input queue.
Definition at line 147 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Queue for input.
Definition at line 149 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Reid status if runtime variables initialized.
Definition at line 136 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Lock associated with output.
Definition at line 154 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Queue for output.
Definition at line 156 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Config params for reid module.
Definition at line 137 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
Referenced by getReIDServiceType().
|
protected |
Indicates whether the worker thread should keep running.
Definition at line 146 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Number of submitted tasks.
Blocking mode uses this count to wait for the worker thread to finish. These are accessed from both the query thread (producer) and the worker thread (consumer), so they must be atomic to avoid data races (UB).
Definition at line 157 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Target manager of the tracked objects.
Definition at line 138 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.
|
protected |
Worker thread.
Definition at line 145 of file sources/libs/nvmultiobjecttracker/include/modules/ReIDService/ReIDService.hpp.