*/
void ConfigureThreshold(const double threshold);
- /**
- * @brief Configure the input node name
- *
- * @since_tizen 5.5
- * @remarks deprecated Replayced by ConfigureInputInfo
- */
- void ConfigureInputNodeName(const std::string nodeName);
-
- /**
- * @brief Configure the output node names
- *
- * @since_tizen 5.5
- * @remarks deprecated Replaced by ConfigureOutputInfo
- */
- void ConfigureOutputNodeNames(const std::vector<std::string> nodeNames);
-
/**
* @brief Bind a backend engine
* @details Use this function to bind a backend engine for the inference.
*/
int mv_inference_configure_post_process_info_open(mv_inference_h infer, mv_engine_config_h engine_config);
-/**
- * @brief Configure the input node name to the inference handle
- *
- * @since_tizen 5.5
- * @remarks deprecated Replaced by mv_inference_configure_input_info_open
- *
- * @param [in] infer The handle to the inference
- * @param [in] engine_config The handle to the configuration of
- * engine.
- *
- * @return @c 0 on success, otherwise a negative error value
- * @retval #MEDIA_VISION_ERROR_NONE Successful
- * @retval #MEDIA_VISION_ERROR_INVALID_PARAMETER Invalid parameter
- * in @a engine_config
- * @retval #MEDIA_VISION_ERROR_INVALID_PATH Invalid path of model data
- * in @a engine_config
- * @retval #MEDIA_VISION_ERROR_INVALID_DATA Invalid model data
- * @retval #MEDIA_VISION_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #MEDIA_VISION_ERROR_NOT_SUPPORTED Not supported
- */
-int mv_inference_configure_input_node_name_open(mv_inference_h infer, mv_engine_config_h engine_config);
-
/**
* @brief Configure the set of output node names to the inference handle
*
MV_INFERENCE_CONFIDENCE_THRESHOLD_MIN);
}
-void Inference::ConfigureInputNodeName(const std::string nodeName)
-{
- mConfig.mInputLayerNames.push_back(nodeName);
-
- inference_engine_layer_property property;
-
- property.layer_names.push_back(nodeName);
- int ret = mBackend->SetInputLayerProperty(property);
- if (ret != INFERENCE_ENGINE_ERROR_NONE) {
- LOGE("Fail to set input layer property");
- }
-}
-
-void Inference::ConfigureOutputNodeNames(const std::vector<std::string> nodeNames)
-{
- mConfig.mOutputLayerNames = nodeNames;
-
- inference_engine_layer_property property;
-
- property.layer_names = nodeNames;
- int ret = mBackend->SetOutputLayerProperty(property);
- if (ret != INFERENCE_ENGINE_ERROR_NONE) {
- LOGE("Fail to set output layer property");
- }
-}
-
void Inference::CleanupTensorBuffers(void)
{
LOGI("ENTER");
return ret;
}
-int mv_inference_configure_input_node_name_open(mv_inference_h infer, mv_engine_config_h engine_config)
-{
- LOGI("ENTER");
-
- Inference *pInfer = static_cast<Inference *>(infer);
-
- int ret = MEDIA_VISION_ERROR_NONE;
-
- char *node_name = NULL;
-
- ret = mv_engine_config_get_string_attribute(engine_config,
- MV_INFERENCE_INPUT_NODE_NAME,
- &node_name);
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to get tensor width");
- goto _ERROR_;
- }
-
- pInfer->ConfigureInputNodeName(std::string(node_name));
-
-_ERROR_:
-
- if (node_name) {
- free(node_name);
- node_name = NULL;
- }
-
- LOGI("LEAVE");
-
- return ret;
-}
-
-int mv_inference_configure_output_node_names_open(mv_inference_h infer, mv_engine_config_h engine_config)
-{
- LOGI("ENTER");
-
- Inference *pInfer = static_cast<Inference *>(infer);
-
- int ret = MEDIA_VISION_ERROR_NONE;
- int idx = 0;
- char **node_names = NULL;
- int size = 0;
- std::vector<std::string> names;
- ret = mv_engine_config_get_array_string_attribute(engine_config,
- MV_INFERENCE_OUTPUT_NODE_NAMES,
- &node_names,
- &size);
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to get _output_node_names");
- goto _ERROR_;
- }
-
- for (idx = 0 ; idx < size; ++idx)
- names.push_back(std::string(node_names[idx]));
-
- pInfer->ConfigureOutputNodeNames(names);
-
-_ERROR_:
-
- if (node_names) {
- for (idx = 0; idx < size; ++idx) {
- free(node_names[idx]);
- }
- free(node_names);
- node_names = NULL;
- }
-
- LOGI("LEAVE");
-
- return ret;
-}
-
int mv_inference_configure_output_info_open(mv_inference_h infer, mv_engine_config_h engine_config)
{
LOGI("ENTER");