{
private:
std::unique_ptr<AsyncManager<ImageClassificationResult> > _async_manager;
- ImageClassificationResult _current_result {};
+ ImageClassificationResult _current_result;
void loadLabel();
void getEngineList();
std::vector<std::string> _labels;
std::vector<std::string> _valid_backends;
std::vector<std::string> _valid_devices;
- int _backendType;
- int _targetDeviceType;
+ int _backendType {};
+ int _targetDeviceType {};
void getOutputNames(std::vector<std::string> &names);
void getOutpuTensor(std::string &target_name, std::vector<float> &tensor);
public:
ImageClassification();
virtual ~ImageClassification() = default;
+
void preDestroy();
void setUserModel(std::string model_file, std::string meta_file, std::string label_file);
void setEngineInfo(std::string engine_type, std::string device_type);
public:
ImageClassificationDefault();
~ImageClassificationDefault();
+
ImageClassificationResult &result() override;
};
namespace machine_learning
{
struct ImageClassificationInput {
- mv_source_h inference_src;
+ mv_source_h inference_src {};
// TODO.
};
* @details Contains object detection 3d result.
*/
struct ImageClassificationResult {
- unsigned long frame_number;
+ unsigned long frame_number {};
std::string label;
};
{
public:
virtual ~IImageSegmentation() {};
+
virtual void preDestroy() = 0;
virtual ImageSegmentationTaskType getTaskType() = 0;
virtual void setUserModel(std::string model_file, std::string meta_file, std::string label_file) = 0;
class ImageSegmentation : public IImageSegmentation
{
private:
- ImageSegmentationTaskType _task_type;
+ ImageSegmentationTaskType _task_type { ImageSegmentationTaskType::IMAGE_SEGMENTATION_TASK_NONE };
std::unique_ptr<AsyncManager<ImageSegmentationResult> > _async_manager;
ImageSegmentationResult _current_result {};
std::string _modelMetaFilePath;
std::string _modelDefaultPath;
std::string _modelLabelFilePath;
- int _backendType;
- int _targetDeviceType;
+ int _backendType {};
+ int _targetDeviceType {};
void getOutputNames(std::vector<std::string> &names);
void getOutputTensor(std::string target_name, std::vector<float> &tensor);
virtual ImageSegmentationResult &result() = 0;
public:
- ImageSegmentation(ImageSegmentationTaskType task_type);
+ explicit ImageSegmentation(ImageSegmentationTaskType task_type);
virtual ~ImageSegmentation() = default;
+
void preDestroy() override;
ImageSegmentationTaskType getTaskType() override;
void setUserModel(std::string model_file, std::string meta_file, std::string label_file) override;
class ImageSegmentationExternal : public IImageSegmentation
{
private:
- void *_plugin_handle;
- IImageSegmentation *_image_segmentation_plugin;
- ImageSegmentationTaskType _task_type {};
- ImageSegmentationResult _current_result {};
+ void *_plugin_handle {};
+ IImageSegmentation *_image_segmentation_plugin {};
+ ImageSegmentationTaskType _task_type { ImageSegmentationTaskType::IMAGE_SEGMENTATION_TASK_NONE };
+ ImageSegmentationResult _current_result;
public:
- ImageSegmentationExternal(ImageSegmentationTaskType task_type);
+ explicit ImageSegmentationExternal(ImageSegmentationTaskType task_type);
virtual ~ImageSegmentationExternal();
+
void preDestroy() override;
ImageSegmentationTaskType getTaskType() override;
void setUserModel(std::string model_file, std::string meta_file, std::string label_file) override;
namespace machine_learning
{
struct ImageSegmentationInput {
- mv_source_h inference_src;
+ mv_source_h inference_src {};
};
/**
* @details Contains object detection result.
*/
struct ImageSegmentationResult {
- unsigned long frame_number;
- unsigned int width;
- unsigned int height;
- unsigned int pixel_size;
+ unsigned long frame_number {};
+ unsigned int width {};
+ unsigned int height {};
+ unsigned int pixel_size {};
std::vector<unsigned char> data;
};
transform(model_name.begin(), model_name.end(), model_name.begin(), ::toupper);
- ImageSegmentationTaskType task_type = ImageSegmentationTaskType::IMAGE_SEGMENTATION_TASK_NONE;
-
if (model_name == "SELFIE_SEGMENTATION_PLUGIN")
return ImageSegmentationTaskType::SELFIE_SEGMENTATION_PLUGIN;
transform(model_name.begin(), model_name.end(), model_name.begin(), ::toupper);
- LandmarkDetectionTaskType task_type = LandmarkDetectionTaskType::LANDMARK_DETECTION_TASK_NONE;
-
if (model_name == "PLD_CPM")
return LandmarkDetectionTaskType::PLD_CPM;
template class PoseLandmarkAdapter<LandmarkDetectionInput, LandmarkDetectionResult>;
}
-}
\ No newline at end of file
+}
{
public:
virtual ~IObjectDetection() {};
+
virtual void preDestroy() = 0;
virtual ObjectDetectionTaskType getTaskType() = 0;
virtual void setUserModel(std::string model_file, std::string meta_file, std::string label_file) = 0;
class ObjectDetection : public IObjectDetection
{
private:
- ObjectDetectionTaskType _task_type;
+ ObjectDetectionTaskType _task_type { ObjectDetectionTaskType::OBJECT_DETECTION_TASK_NONE };
std::unique_ptr<AsyncManager<ObjectDetectionResult> > _async_manager;
- ObjectDetectionResult _current_result {};
+ ObjectDetectionResult _current_result;
void loadLabel();
void getEngineList();
std::string _modelMetaFilePath;
std::string _modelDefaultPath;
std::string _modelLabelFilePath;
- int _backendType;
- int _targetDeviceType;
+ int _backendType {};
+ int _targetDeviceType {};
void getOutputNames(std::vector<std::string> &names);
void getOutputTensor(std::string target_name, std::vector<float> &tensor);
virtual ObjectDetectionResult &result() = 0;
public:
- ObjectDetection(ObjectDetectionTaskType task_type);
+ explicit ObjectDetection(ObjectDetectionTaskType task_type);
virtual ~ObjectDetection() = default;
+
void preDestroy() override;
ObjectDetectionTaskType getTaskType() override;
void setUserModel(std::string model_file, std::string meta_file, std::string label_file) override;
class ObjectDetectionExternal : public IObjectDetection
{
private:
- void *_plugin_handle;
- IObjectDetection *_object_detection_plugin;
- ObjectDetectionTaskType _task_type {};
- ObjectDetectionResult _current_result {};
+ void *_plugin_handle {};
+ IObjectDetection *_object_detection_plugin {};
+ ObjectDetectionTaskType _task_type { ObjectDetectionTaskType::OBJECT_DETECTION_TASK_NONE };
+ ObjectDetectionResult _current_result;
public:
- ObjectDetectionExternal(ObjectDetectionTaskType task_type);
+ explicit ObjectDetectionExternal(ObjectDetectionTaskType task_type);
virtual ~ObjectDetectionExternal();
+
void preDestroy() override;
ObjectDetectionTaskType getTaskType() override;
void setUserModel(std::string model_file, std::string meta_file, std::string label_file) override;
namespace machine_learning
{
struct ObjectDetectionInput {
- mv_source_h inference_src;
+ mv_source_h inference_src {};
// TODO.
};
* @details Contains object detection result.
*/
struct ObjectDetectionResult {
- unsigned long frame_number;
+ unsigned long frame_number {};
unsigned int number_of_objects {};
std::vector<unsigned int> indices;
std::vector<std::string> names;
template class FaceDetectionAdapter<ObjectDetectionInput, ObjectDetectionResult>;
}
-}
\ No newline at end of file
+}
transform(model_name.begin(), model_name.end(), model_name.begin(), ::toupper);
- ObjectDetectionTaskType task_type = ObjectDetectionTaskType::OBJECT_DETECTION_TASK_NONE;
-
if (model_name == "OD_PLUGIN")
return ObjectDetectionTaskType::OD_PLUGIN;
else if (model_name == "FD_PLUGIN")
std::vector<std::vector<float> > _data;
std::vector<std::vector<float> > _labels;
std::vector<unsigned int> _label_index;
- size_t _feature_vector_size;
- size_t _label_count;
+ size_t _feature_vector_size {};
+ size_t _label_count {};
public:
DataSetManager();
std::vector<std::string> output_layer_names;
std::vector<inference_engine_tensor_info> input_tensor_info;
std::vector<inference_engine_tensor_info> output_tensor_info;
- training_engine_optimizer_property optimizer_property;
- training_engine_compile_property compile_property;
+ training_engine_optimizer_property optimizer_property {};
+ training_engine_compile_property compile_property {};
};
class TrainingModel