|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
18 #ifndef REIDSERVICE_HPP_
19 #define REIDSERVICE_HPP_
23 #include "modules/ReIDService/IReIDService.hpp"
24 #include <curl/curl.h>
50 void read(
const YAML::Node &fn)
override;
114 const std::shared_ptr<NvTrackedObjectManager> &targetManager
127 void query(
const std::map<NvMOTStreamId, NvMOTFrame *> &inputMeta)
override;
178 const std::shared_ptr<NvTrackedObject> targetToBeCorrected,
179 const std::shared_ptr<NvTrackedObject> existingTarget,
TargetId associatedTargetID
215 #endif // REIDSERVICE_HPP_
std::shared_ptr< NvTrackedObjectManager > m_targetManager
Target manager of the tracked objects.
std::atomic< uint32_t > m_submittedReqCnt
Number of submitted tasks.
std::mutex m_inputLock
Lock associated with input queue.
std::queue< remoteTargetInfo > m_outputQueue
Queue for output.
int m_debugVerboseLevel
Debug message verbose mode level.
std::queue< CurlRequestTargetInfo > m_inputQueue
Queue for input.
Stores configuration for the remote ReID service.
int m_maxGroupCount
Maximum number of vectors per object id to be considered for reid service association.
std::mutex m_outputLock
Lock associated with output.
remoteTargetInfo parseResponseForTargetID(const std::string &response)
Parse a remote identity result from a service response.
int m_maxInFlightRequests
Maximum number of in-flight requests, requests beyond this are dropped.
void updateTargetIDs() override
Update target ID using remoteTargetID from reid service.
std::string response
Response text received from the service.
TargetId remoteTargetID
Target ID returned by the remote service.
void workerThread()
Process queued remote ReID requests.
bool appendCurlRequest(const CurlRequestTargetInfo &curlRequestInfoInput)
Add a request to the asynchronous CURL multi-handle.
NvMOTStreamId streamId
Stream ID of the queried target.
std::map< NvMOTStreamId, std::map< TargetId, std::pair< TargetId, int > > > m_idCorrectionMap
Target-ID corrections keyed by stream ID.
Holds CURL state and target metadata for one service request.
std::string m_serviceAddress
Address/hostname for the reid service.
const REID_SERVICE_TYPES getReIDServiceType() override
Get the configured ReID-service implementation type.
float m_minSecondClusterConfidence
Minimum confidence for second cluster to be considered for ambiguity checking.
bool m_enableBlocking
Whether to enable blocking mode.
void waitToFinish()
Wait until all submitted service requests have completed.
void read(const YAML::Node &fn) override
Load configuration values from a YAML node.
bool m_isInit
Reid status if runtime variables initialized.
float m_maxIou4IDCorrection
Maximum IOU for ID correction.
std::atomic< uint32_t > m_finishedReqCnt
Keep track of how many tasks are finished.
int m_topK
Maximum number of object ids to be returned by reid service association.
float m_maxClusterVariance
Maximum cluster variance to be considered for reid service association.
float m_minVisibility4ReidServiceQuery
Minimum visibility for reid service association query.
TargetId originalTargetID
Target ID at query time.
struct curl_slist * headers
Per-request header list freed with curl_slist_free_all.
std::string jsonPayload
JSON request payload.
Provides common loading helpers for tracker configuration parameters.
REID_SERVICE_TYPES
Identifies the available ReID-service implementations.
ReIDServiceConfigParams()
Construct a ReIDServiceConfigParams instance.
REID_SERVICE_TYPES m_reidServiceType
Type of reid service.
std::thread m_workerThread
Worker thread.
void queryParams(NvMOTQuery ¶msQuery)
Populate the capabilities reported to the tracker.
int m_servicePort
Port for the reid service.
std::atomic< bool > m_persistThreadRunning
Indicates whether the worker thread should keep running.
TargetId targetID
Target ID at query time.
int m_curlRequestTimeout
CURL request timeout in seconds.
NvMOTStreamId streamId
Stream ID of the queried target.
std::string m_curlRequestUrl
CURL request URL.
Holds the capabilities and requirements reported by the tracker library.
int m_minAssociationCount4IDCorrection
Minimum number of successful associations for ID correction.
std::vector< int > m_operateOnClassIds
Class IDs used for ReID service association. An empty list enables association for all classes.
std::map< CURL *, CurlRequestTargetInfo > m_curlRequestInfoMap
Active CURL handles.
std::condition_variable m_cond4In
Wakes the worker when the input queue receives a request.
void query(const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta) override
Send query to reid service for all unmatched active objects.
bool validRemoteTargetID
Indicates whether the remote target ID can be adopted.
void processCompletedCurlRequest(CURLMsg *msg)
Collect the result of a completed CURL request.
bool m_enableIDCorrection
Whether to enable ID correction.
Information about the input source frames for the input frame batch.
TrackerIndex targetIndex
Tracker index of the queried target.
Defines the interface for remote ReID association services.
TrackerIndex targetIndex
Tracker index of the queried target.
std::condition_variable m_cond4Out
Wakes the caller when the worker finishes a request.
ReIDServiceConfigParams m_params
Config params for reid module.
std::string send_post_request(const std::string &jsonPayload)
Send one synchronous HTTP POST request.
void initialize(const SourceFrameInfo &frameInfo, const uint maxTargetsPerStream, const std::shared_ptr< NvTrackedObjectManager > &targetManager) override
Initialize variables and allocate memories.
Associates local targets with identities returned by a remote service.
int m_curlConnectTimeout
CURL connect timeout in seconds.
ReIDService(const std::string &configFilePath)
Construct a ReIDService instance from configuration.
std::string convertReidFeaturesToJson(const float *reidFeatures, int reidFeatureSize)
Serialize a ReID feature vector as JSON.
float m_minTopClusterConfidence
Minimum confidence for top cluster to be considered for reid service association.
std::map< TargetId, reidServiceAssocInfo > reidServiceAssocResponseMap
Association details keyed by target ID.
CURLM * m_curlMultiHandle
CURL multi handle.
Output of a successful reid service association.
virtual ~ReIDService()
Release resources owned by the ReIDService instance.
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.