{
public:
virtual ~ITask() {};
- virtual void create(int type) = 0;
virtual void setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name = "") = 0;
virtual void setEngineInfo(const char *engine_type, const char *device_type) = 0;
return _config;
}
- void create(int type) override;
void setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name) override;
void setEngineInfo(const char *engine_type, const char *device_type) override;
FacenetAdapter();
~FacenetAdapter();
- void create(int type) override;
void setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name) override;
void setEngineInfo(const char *engine_type, const char *device_type) override;
template<typename T, typename V> FaceRecognitionAdapter<T, V>::~FaceRecognitionAdapter()
{}
-template<typename T, typename V> void FaceRecognitionAdapter<T, V>::create(int type)
-{
- throw InvalidOperation("Not support yet.");
-}
-
template<typename T, typename V>
void FaceRecognitionAdapter<T, V>::setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name)
template<typename T, typename V> FacenetAdapter<T, V>::~FacenetAdapter()
{}
-template<typename T, typename V> void FacenetAdapter<T, V>::create(int type)
-{
- throw InvalidOperation("Not support yet.");
-}
-
template<typename T, typename V>
void FacenetAdapter<T, V>::setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name)
ImageClassificationAdapter();
~ImageClassificationAdapter();
- void create(int type) override;
void setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name) override;
void setEngineInfo(const char *engine_type, const char *device_type) override;
template<typename T, typename V> ImageClassificationAdapter<T, V>::~ImageClassificationAdapter()
{}
-template<typename T, typename V> void ImageClassificationAdapter<T, V>::create(int type)
-{
- throw InvalidOperation("Interface not supported.");
-}
-
template<typename T, typename V>
void ImageClassificationAdapter<T, V>::setModelInfo(const char *model_file, const char *meta_file,
const char *label_file, const char *model_name)
std::string _meta_file;
std::string _label_file;
+ void create(LandmarkDetectionTaskType task_type);
+
public:
FacialLandmarkAdapter();
~FacialLandmarkAdapter();
- void create(int type) override;
-
void setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name) override;
void setEngineInfo(const char *engine_type, const char *device_type) override;
std::string _meta_file;
std::string _label_file;
+ void create(LandmarkDetectionTaskType task_type);
+
public:
PoseLandmarkAdapter();
~PoseLandmarkAdapter();
- void create(int type) override;
-
void setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name) override;
void setEngineInfo(const char *engine_type, const char *device_type) override;
template<typename T, typename V> FacialLandmarkAdapter<T, V>::~FacialLandmarkAdapter()
{}
-template<typename T, typename V> void FacialLandmarkAdapter<T, V>::create(int type)
+template<typename T, typename V> void FacialLandmarkAdapter<T, V>::create(LandmarkDetectionTaskType task_type)
{
- LandmarkDetectionTaskType task_type = static_cast<LandmarkDetectionTaskType>(type);
-
// If default task type is same as a given one then skip.
if (_landmark_detection->getTaskType() == task_type)
return;
if (!model_name_str.empty()) {
transform(model_name_str.begin(), model_name_str.end(), model_name_str.begin(), ::toupper);
- int model_type = 0;
+ LandmarkDetectionTaskType task_type = LandmarkDetectionTaskType::LANDMARK_DETECTION_TASK_NONE;
if (model_name_str == string("FLD_TWEAK_CNN"))
- model_type = static_cast<int>(LandmarkDetectionTaskType::FLD_TWEAK_CNN);
+ task_type = LandmarkDetectionTaskType::FLD_TWEAK_CNN;
// TODO.
else
throw InvalidParameter("Invalid landmark detection model name.");
- create(static_cast<int>(model_type));
+ create(task_type);
}
_model_file = string(model_file);
template<typename T, typename V> PoseLandmarkAdapter<T, V>::~PoseLandmarkAdapter()
{}
-template<typename T, typename V> void PoseLandmarkAdapter<T, V>::create(int type)
+template<typename T, typename V> void PoseLandmarkAdapter<T, V>::create(LandmarkDetectionTaskType task_type)
{
- LandmarkDetectionTaskType task_type = static_cast<LandmarkDetectionTaskType>(type);
-
// If default task type is same as a given one then skip.
if (_landmark_detection->getTaskType() == task_type)
return;
if (!model_name_str.empty()) {
transform(model_name_str.begin(), model_name_str.end(), model_name_str.begin(), ::toupper);
- int model_type = 0;
+ LandmarkDetectionTaskType task_type = LandmarkDetectionTaskType::LANDMARK_DETECTION_TASK_NONE;
if (model_name_str == string("PLD_CPM"))
- model_type = static_cast<int>(LandmarkDetectionTaskType::PLD_CPM);
+ task_type = LandmarkDetectionTaskType::PLD_CPM;
// TODO.
else
throw InvalidParameter("Invalid landmark detection model name.");
- create(static_cast<int>(model_type));
+ create(task_type);
}
_model_file = string(model_file);
std::string _meta_file;
std::string _label_file;
+ void create(ObjectDetectionTaskType task_type);
+
public:
FaceDetectionAdapter();
~FaceDetectionAdapter();
- void create(int type) override;
-
void setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name) override;
void setEngineInfo(const char *engine_type, const char *device_type) override;
std::string _meta_file;
std::string _label_file;
+ void create(ObjectDetectionTaskType task_type);
+
public:
ObjectDetectionAdapter();
~ObjectDetectionAdapter();
- void create(int type) override;
-
void setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name) override;
void setEngineInfo(const char *engine_type, const char *device_type) override;
_object_detection->preDestroy();
}
-template<typename T, typename V> void FaceDetectionAdapter<T, V>::create(int type)
+template<typename T, typename V> void FaceDetectionAdapter<T, V>::create(ObjectDetectionTaskType task_type)
{
- ObjectDetectionTaskType task_type = static_cast<ObjectDetectionTaskType>(type);
-
// If default task type is same as a given one then skip.
if (_object_detection->getTaskType() == task_type)
return;
if (!model_name_str.empty()) {
transform(model_name_str.begin(), model_name_str.end(), model_name_str.begin(), ::toupper);
- int model_type = 0;
+ ObjectDetectionTaskType task_type = ObjectDetectionTaskType::OBJECT_DETECTION_TASK_NONE;
if (model_name_str == string("FD_MOBILENET_V1_SSD"))
- model_type = static_cast<int>(ObjectDetectionTaskType::FD_MOBILENET_V1_SSD);
+ task_type = ObjectDetectionTaskType::FD_MOBILENET_V1_SSD;
// TODO.
else
throw InvalidParameter("Invalid face detection model name.");
- create(static_cast<int>(model_type));
+ create(task_type);
}
_model_file = string(model_file);
_object_detection->preDestroy();
}
-template<typename T, typename V> void ObjectDetectionAdapter<T, V>::create(int type)
+template<typename T, typename V> void ObjectDetectionAdapter<T, V>::create(ObjectDetectionTaskType task_type)
{
- ObjectDetectionTaskType task_type = static_cast<ObjectDetectionTaskType>(type);
-
// If default task type is same as a given one then skip.
if (_object_detection->getTaskType() == task_type)
return;
if (!model_name_str.empty()) {
transform(model_name_str.begin(), model_name_str.end(), model_name_str.begin(), ::toupper);
- int model_type = 0;
+ ObjectDetectionTaskType task_type = ObjectDetectionTaskType::OBJECT_DETECTION_TASK_NONE;
if (model_name_str == "OD_PLUGIN" || model_name_str == "FD_PLUGIN") {
if (model_name_str == "OD_PLUGIN")
- model_type = static_cast<int>(ObjectDetectionTaskType::OD_PLUGIN);
+ task_type = ObjectDetectionTaskType::OD_PLUGIN;
if (model_name_str == "FD_PLUGIN")
- model_type = static_cast<int>(ObjectDetectionTaskType::FD_PLUGIN);
+ task_type = ObjectDetectionTaskType::FD_PLUGIN;
// In case of using plugin module, model information will be managed by the plugin module.
// Therefore, create plugin instance now.
- create(model_type);
+ create(task_type);
return;
}
if (model_name_str == string("MOBILENET_V1_SSD")) {
- model_type = static_cast<int>(ObjectDetectionTaskType::MOBILENET_V1_SSD);
+ task_type = ObjectDetectionTaskType::MOBILENET_V1_SSD;
} else if (model_name_str == string("MOBILENET_V2_SSD")) {
- model_type = static_cast<int>(ObjectDetectionTaskType::MOBILENET_V2_SSD);
+ task_type = ObjectDetectionTaskType::MOBILENET_V2_SSD;
// TODO.
} else {
throw InvalidParameter("Invalid object detection model name.");
}
- create(model_type);
+ create(task_type);
}
_model_file = string(model_file);
std::string _meta_file;
std::string _label_file;
+ void create(ObjectDetection3dTaskType task_type);
+
public:
ObjectDetection3dAdapter();
~ObjectDetection3dAdapter();
- void create(int type) override;
void setModelInfo(const char *model_file, const char *meta_file, const char *label_file,
const char *model_name) override;
void setEngineInfo(const char *engine_type, const char *device_type) override;
template<typename T, typename V> ObjectDetection3dAdapter<T, V>::~ObjectDetection3dAdapter()
{}
-template<typename T, typename V> void ObjectDetection3dAdapter<T, V>::create(int type)
+template<typename T, typename V> void ObjectDetection3dAdapter<T, V>::create(ObjectDetection3dTaskType task_type)
{}
template<typename T, typename V>
if (!model_name_str.empty()) {
transform(model_name_str.begin(), model_name_str.end(), model_name_str.begin(), ::toupper);
- int model_type = 0;
+ ObjectDetection3dTaskType task_type = ObjectDetection3dTaskType::OBJECT_DETECTION_3D_TASK_NONE;
if (model_name_str == string("OBJECTRON"))
- model_type = static_cast<int>(ObjectDetection3dTaskType::OBJECTRON);
+ task_type = ObjectDetection3dTaskType::OBJECTRON;
else
throw InvalidParameter("Invalid object detection 3d model name.");
- create(static_cast<int>(model_type));
+ create(task_type);
}
_model_file = string(model_file);