|
|
NVIDIA DeepStream SDK API Reference
|
9.2 Release
|
Go to the documentation of this file.
18 #ifndef VISUALTRACKERLIB_VISUALTRACKER_FACTORY_HPP_
19 #define VISUALTRACKERLIB_VISUALTRACKER_FACTORY_HPP_
22 #include "modules/NvMultiObjectTracker/NvTrackerParams.hpp"
23 #include "modules/VisualTracker/IVisualTracker.hpp"
26 #include "modules/VisualTracker/DummyVisualTracker.hpp"
28 #include "modules/VisualTracker/VisualTracker.hpp"
29 #include "modules/VisualTracker/DCFTracker.hpp"
50 this->
read(configRoot[moduleName]);
66 void read(
const YAML::Node &fn)
override
70 if(!fn.size()) {
return;}
72 for (YAML::const_iterator fit = fn.begin(); fit != fn.end(); ++fit)
74 std::string paramKey = fit->first.as<std::string>();
76 if (paramKey ==
"visualTrackerType")
78 int trackerTypeInt = (int)fit->second.as<
float>();
80 if (trackerTypeInt < 0 || trackerTypeInt > 2)
82 throw std::runtime_error(
83 "Invalid visualTrackerType value: " + std::to_string(trackerTypeInt) +
". Valid range is 0-2 (0=DUMMY_VOT, 1=NvDCF_VOT, 2=NvDCF_VPI_VOT)."
116 throw std::runtime_error(
"Only IOU tracking is available in the Windows tracker build");
118 return std::make_shared<DummyVisualTracker>(configFilePath);
127 return std::make_shared<VisualTracker>(configFilePath);
131 return std::make_shared<DCFTracker>(configFilePath);
136 return std::make_shared<DummyVisualTracker>(configFilePath);
148 #endif // VISUALTRACKERLIB_VISUALTRACKER_FACTORY_HPP_
VISUAL_TRACKER_TYPES m_visualTrackerType
The type of visual tracker.
VisualTrackerFactoryParams(const YAML::Node &fn)
Construct factory parameters from a YAML node.
VisualTrackerFactoryParams m_params
Config params for visual tracker module.
Configuration parameters for the visual tracker factory.
VisualTrackerFactoryParams(const std::string &configFilePath, const std::string moduleName)
Construct factory parameters from a named module in a file.
std::shared_ptr< IVisualTracker > makeVisualTracker(const std::string configFilePath)
Create the visual tracker selected by a configuration file.
static const YAML::Node getConfigRoot(const std::string &configFilePath, const bool printMessage=false)
Load the root YAML node from a tracker configuration file.
Create a concrete visual tracker from the configuration.
VisualTrackerFactoryParams()
Construct default factory parameters selecting the dummy tracker.
void read(const YAML::Node &fn) override
Read visual tracker factory parameters from a YAML node.
VISUAL_TRACKER_TYPES
Visual tracker implementations that can be selected by configuration.
@ DUMMY_VOT
Selects the dummy visual tracker.
Provides common loading helpers for tracker configuration parameters.
static VisualTrackerFactory & getInstance()
Return the process-wide visual tracker factory instance.
@ NvDCF_VOT
Selects the NvDCF visual tracker.
@ NvDCF_VPI_VOT
Selects the VPI-based NvDCF visual tracker.