void loadLabel();
void getEngineList();
void getDeviceList(const std::string &engine_type);
- void preprocess(mv_source_h &mv_src, std::shared_ptr<MetaInfo> metaInfo, std::vector<T> &inputVector);
+ void configurePreprocess();
std::shared_ptr<MetaInfo> getInputMetaInfo();
protected:
ret = _inference->load();
if (ret != MEDIA_VISION_ERROR_NONE)
throw InvalidOperation("Fail to load model files.");
+
+ configurePreprocess();
}
template<typename T> shared_ptr<MetaInfo> ImageSegmentation<T>::getInputMetaInfo()
return _config->getInputMetaMap()[tensor_buffer_iter->first];
}
-template<typename T>
-void ImageSegmentation<T>::preprocess(mv_source_h &mv_src, shared_ptr<MetaInfo> metaInfo, vector<T> &inputVector)
+template<typename T> void ImageSegmentation<T>::configurePreprocess()
{
LOGI("ENTER");
+ shared_ptr<MetaInfo> metaInfo = getInputMetaInfo();
+
PreprocessConfig config = { false,
metaInfo->colorSpace,
metaInfo->dataType,
}
_preprocess.setConfig(config);
- _preprocess.run<T>(mv_src, inputVector);
LOGI("LEAVE");
}
template<typename T> void ImageSegmentation<T>::perform(mv_source_h &mv_src)
{
- shared_ptr<MetaInfo> metaInfo = getInputMetaInfo();
- vector<T> inputVector;
+ vector<vector<T> > inputVectors(1);
- preprocess(mv_src, metaInfo, inputVector);
+ _preprocess.run<T>(mv_src, inputVectors[0]);
- vector<vector<T> > inputVectors = { inputVector };
inference(inputVectors);
}
});
}
- shared_ptr<MetaInfo> metaInfo = getInputMetaInfo();
- vector<T> inputVector;
+ vector<vector<T> > inputVectors(1);
- preprocess(input.inference_src, metaInfo, inputVector);
+ _preprocess.run<T>(input.inference_src, inputVectors[0]);
- vector<vector<T> > inputVectors = { inputVector };
_async_manager->push(inputVectors);
}
void getEngineList();
void getDeviceList(const std::string &engine_type);
- void preprocess(mv_source_h &mv_src, std::shared_ptr<MetaInfo> metaInfo, std::vector<T> &inputVector);
+ void configurePreprocess();
std::shared_ptr<MetaInfo> getInputMetaInfo();
protected:
ret = _inference->load();
if (ret != MEDIA_VISION_ERROR_NONE)
throw InvalidOperation("Fail to load model files.");
+
+ configurePreprocess();
}
template<typename T> shared_ptr<MetaInfo> LandmarkDetection<T>::getInputMetaInfo()
return _config->getInputMetaMap()[tensor_buffer_iter->first];
}
-template<typename T>
-void LandmarkDetection<T>::preprocess(mv_source_h &mv_src, shared_ptr<MetaInfo> metaInfo, vector<T> &inputVector)
+template<typename T> void LandmarkDetection<T>::configurePreprocess()
{
LOGI("ENTER");
+ shared_ptr<MetaInfo> metaInfo = getInputMetaInfo();
+
PreprocessConfig config = { false,
metaInfo->colorSpace,
metaInfo->dataType,
}
_preprocess.setConfig(config);
- _preprocess.run<T>(mv_src, inputVector);
LOGI("LEAVE");
}
template<typename T> void LandmarkDetection<T>::perform(mv_source_h &mv_src)
{
- shared_ptr<MetaInfo> metaInfo = getInputMetaInfo();
- vector<T> inputVector;
+ vector<vector<T> > inputVectors(1);
- preprocess(mv_src, metaInfo, inputVector);
+ _preprocess.run<T>(mv_src, inputVectors[0]);
- vector<vector<T> > inputVectors = { inputVector };
inference(inputVectors);
}
});
}
- shared_ptr<MetaInfo> metaInfo = getInputMetaInfo();
- vector<T> inputVector;
+ vector<vector<T> > inputVectors(1);
- preprocess(input.inference_src, metaInfo, inputVector);
+ _preprocess.run<T>(input.inference_src, inputVectors[0]);
- vector<vector<T> > inputVectors = { inputVector };
_async_manager->push(inputVectors);
}
void loadLabel();
void getEngineList();
void getDeviceList(const std::string &engine_type);
- void preprocess(mv_source_h &mv_src, std::shared_ptr<MetaInfo> metaInfo, std::vector<T> &inputVector);
+ void configurePreprocess();
std::shared_ptr<MetaInfo> getInputMetaInfo();
protected:
ret = _inference->load();
if (ret != MEDIA_VISION_ERROR_NONE)
throw InvalidOperation("Fail to load model files.");
+
+ configurePreprocess();
}
template<typename T> shared_ptr<MetaInfo> ObjectDetection<T>::getInputMetaInfo()
return _config->getInputMetaMap()[tensor_buffer_iter->first];
}
-template<typename T>
-void ObjectDetection<T>::preprocess(mv_source_h &mv_src, shared_ptr<MetaInfo> metaInfo, vector<T> &inputVector)
+template<typename T> void ObjectDetection<T>::configurePreprocess()
{
LOGI("ENTER");
+ shared_ptr<MetaInfo> metaInfo = getInputMetaInfo();
+
PreprocessConfig config = { false,
metaInfo->colorSpace,
metaInfo->dataType,
}
_preprocess.setConfig(config);
- _preprocess.run<T>(mv_src, inputVector);
LOGI("LEAVE");
}
template<typename T> void ObjectDetection<T>::perform(mv_source_h &mv_src)
{
- shared_ptr<MetaInfo> metaInfo = getInputMetaInfo();
- vector<T> inputVector;
+ vector<vector<T> > inputVectors(1);
- preprocess(mv_src, metaInfo, inputVector);
+ _preprocess.run<T>(mv_src, inputVectors[0]);
- vector<vector<T> > inputVectors = { inputVector };
inference(inputVectors);
}
});
}
- shared_ptr<MetaInfo> metaInfo = getInputMetaInfo();
- vector<T> inputVector;
+ vector<vector<T> > inputVectors(1);
- preprocess(input.inference_src, metaInfo, inputVector);
+ _preprocess.run<T>(input.inference_src, inputVectors[0]);
- vector<vector<T> > inputVectors = { inputVector };
_async_manager->push(inputVectors);
}
void getOutputNames(std::vector<std::string> &names);
void getOutputTensor(std::string &target_name, std::vector<float> &tensor);
- void preprocess(mv_source_h &mv_src, std::shared_ptr<MetaInfo> metaInfo, std::vector<T> &inputVector);
+ void configurePreprocess();
void inference(std::vector<std::vector<T> > &inputVectors);
public:
ret = _inference->load();
if (ret != MEDIA_VISION_ERROR_NONE)
throw InvalidOperation("Fail to load model files.");
+
+ configurePreprocess();
}
template<typename T> shared_ptr<MetaInfo> ObjectDetection3d<T>::getInputMetaInfo()
return _config->getInputMetaMap()[tensor_buffer_iter->first];
}
-template<typename T>
-void ObjectDetection3d<T>::preprocess(mv_source_h &mv_src, shared_ptr<MetaInfo> metaInfo, vector<T> &inputVector)
+template<typename T> void ObjectDetection3d<T>::configurePreprocess()
{
LOGI("ENTER");
+ shared_ptr<MetaInfo> metaInfo = getInputMetaInfo();
+
PreprocessConfig config = { false,
metaInfo->colorSpace,
metaInfo->dataType,
}
_preprocess.setConfig(config);
- _preprocess.run<T>(mv_src, inputVector);
LOGI("LEAVE");
}
template<typename T> void ObjectDetection3d<T>::perform(mv_source_h &mv_src, shared_ptr<MetaInfo> metaInfo)
{
- vector<T> inputVector;
-
- preprocess(mv_src, metaInfo, inputVector);
+ vector<vector<T> > inputVectors(1);
- vector<vector<T> > inputVectors = { inputVector };
+ _preprocess.run<T>(mv_src, inputVectors[0]);
inference(inputVectors);
}