NVIDIA DeepStream SDK API Reference

9.2 Release
sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef REIDLIB_DUMMYREID_HPP_
19 #define REIDLIB_DUMMYREID_HPP_
20 
21 #include "modules/ReID/IReID.hpp"
22 #include "modules/VisualTracker/IVisualTracker.hpp"
23 #include "modules/NvMultiObjectTracker/NvTrackerParams.hpp"
24 #include "modules/NvMultiObjectTracker/NvTrackedObject.hpp"
25 
28 {
29 public:
32 
38  DummyReIDConfigParams(const std::string &configFilePath, const std::string moduleName);
39 
44  DummyReIDConfigParams(const YAML::Node &fn);
45 
50  void read(const YAML::Node &fn) override;
51 
54 };
55 
57 class DummyReID : public IReID
58 {
59 public:
60 
65  DummyReID(const std::string &configFilePath);
66 
68  virtual ~DummyReID();
69 
76  void initializeRuntime(
77  const SourceFrameInfo &frameInfo, const uint maxTargetsPerStream,
78  const std::shared_ptr<NvTrackedObjectManager> &targetManager
79  ) override;
80 
82  void initializeModel() override;
83 
88  void queryParams(NvMOTQuery &paramsQuery);
89 
96  void doInference(
97  const std::map<NvMOTStreamId, NvMOTFrame *>& inputMeta,
98  std::map<NvMOTStreamId, std::deque<DetectedObjInfo>> &detectedObjects, const bool isForReAssoc
99  ) override;
100 
102  void update() override;
103 
108  void removeStream(const NvMOTStreamId videoStreamId) override;
109 
114  void outputReIDTensor(NvDsReidTensorBatch& reidTensorBatch) override;
115 
122  int outputTargetReIDInd(NvMOTStreamId streamId, uint targetInd) override;
123 
131  void outputTargetReIDObj(
132  NvMOTStreamId streamId, uint targetInd, NvDsReidTensorBatch& reidTensorBatch, NvDsObjReid& reidObj
133  ) override;
134 
136  bool isModelInitialized() override { return m_isModelInit; }
137 
139  bool isRuntimeInitialized() override { return m_isRuntimeInit; }
140 
142  const REID_TYPES getReIDType() override { return m_params.m_reidType; }
143 
144 protected:
145 
149 };
150 
151 #endif // REIDLIB_DUMMYREID_HPP_
DummyReIDConfigParams::m_reidType
REID_TYPES m_reidType
The type of reid.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp:53
DummyReID::queryParams
void queryParams(NvMOTQuery &paramsQuery)
Populate the capabilities reported to the tracker.
DummyReID::outputTargetReIDInd
int outputTargetReIDInd(NvMOTStreamId streamId, uint targetInd) override
Output a target's ReID vector index in the batch tensor.
DummyReID::getReIDType
const REID_TYPES getReIDType() override
Get the configured ReID implementation type.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp:142
DummyReID::~DummyReID
virtual ~DummyReID()
Release resources owned by the DummyReID instance.
DummyReID::outputTargetReIDObj
void outputTargetReIDObj(NvMOTStreamId streamId, uint targetInd, NvDsReidTensorBatch &reidTensorBatch, NvDsObjReid &reidObj) override
Output a target's ReID vector information.
DummyReIDConfigParams
Stores configuration for a ReID implementation.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp:27
DummyReID::outputReIDTensor
void outputReIDTensor(NvDsReidTensorBatch &reidTensorBatch) override
Output the ReID tensor of a batch.
DummyReID::doInference
void doInference(const std::map< NvMOTStreamId, NvMOTFrame * > &inputMeta, std::map< NvMOTStreamId, std::deque< DetectedObjInfo >> &detectedObjects, const bool isForReAssoc) override
Crop and rescale detected objects to create input batch to reid model.
DummyReID
Provides a no-op ReID implementation.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp:57
REID_TYPES
REID_TYPES
Types of ReID usage.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/IReID.hpp:27
DummyReID::isRuntimeInitialized
bool isRuntimeInitialized() override
Report whether runtime resources are initialized.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp:139
_NvDsObjReid
Holds Reid Vector information for an object.
Definition: includes/nvds_tracker_meta.h:164
uint
unsigned int uint
Definition: sources/libs/nvmultiobjecttracker/include/modules/cuDCFv2/helper_math.h:25
DummyReID::DummyReID
DummyReID(const std::string &configFilePath)
Construct a DummyReID instance from configuration.
DummyReID::m_params
DummyReIDConfigParams m_params
Config params for reid module.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp:148
DummyReID::initializeModel
void initializeModel() override
Create TensorRT inference engine; if engine does not exist, serialize from model file.
DummyReID::m_isModelInit
bool m_isModelInit
Reid status if reid model initialized.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp:146
DummyReIDConfigParams::DummyReIDConfigParams
DummyReIDConfigParams()
Construct a DummyReIDConfigParams instance.
NvTrackerParams
Provides common loading helpers for tracker configuration parameters.
Definition: sources/libs/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/NvTrackerParams.hpp:35
NvMOTStreamId
uint64_t NvMOTStreamId
Definition: includes/nvdstracker.h:53
DummyReIDConfigParams::m_debugVerboseLevel
int m_debugVerboseLevel
Debug message verbose mode level.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp:52
DummyReID::isModelInitialized
bool isModelInitialized() override
Report whether the inference model is initialized.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp:136
DummyReID::update
void update() override
Update ReID feature gallery after data association.
DummyReID::initializeRuntime
void initializeRuntime(const SourceFrameInfo &frameInfo, const uint maxTargetsPerStream, const std::shared_ptr< NvTrackedObjectManager > &targetManager) override
Initialize variables and allocate memories.
_NvMOTQuery
Holds the capabilities and requirements reported by the tracker library.
Definition: includes/nvdstracker.h:420
DummyReID::removeStream
void removeStream(const NvMOTStreamId videoStreamId) override
Remove a stream's reid features.
IReID
Defines the interface for extracting and managing ReID features.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/IReID.hpp:36
SourceFrameInfo
Information about the input source frames for the input frame batch.
Definition: sources/libs/nvmultiobjecttracker/include/modules/NvMultiObjectTracker/NvMultiObjectTracker_common.hpp:49
DummyReIDConfigParams::read
void read(const YAML::Node &fn) override
Load configuration values from a YAML node.
_NvDsReidTensorBatch
ReID tensor of the batch.
Definition: includes/nvds_tracker_meta.h:128
DummyReID::m_isRuntimeInit
bool m_isRuntimeInit
Reid status if runtime variables initialized.
Definition: sources/libs/nvmultiobjecttracker/include/modules/ReID/DummyReID.hpp:147