char *modelWeightFilePath = NULL;
char *modelUserFilePath = NULL;
char *modelMetaFilePath = NULL;
- double modelMeanValue = 0.0;
int backendType = 0;
size_t userFileLength = 0;
goto release_model_weight_file_path;
}
- ret = mv_engine_config_get_string_attribute(
- engine_config, MV_INFERENCE_MODEL_META_FILE_PATH,
- &modelMetaFilePath);
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to get model meta file path");
- goto release_model_user_file_path;
- }
-
- ret = mv_engine_config_get_double_attribute(
- engine_config, MV_INFERENCE_MODEL_MEAN_VALUE, &modelMeanValue);
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to get model mean value");
- goto release_model_meta_file_path;
- }
-
ret = mv_engine_config_get_int_attribute(
engine_config, MV_INFERENCE_BACKEND_TYPE, &backendType);
if (ret != MEDIA_VISION_ERROR_NONE) {
LOGE("Fail to get inference backend type");
- goto release_model_meta_file_path;
+ goto release_model_user_file_path;
}
if (!IsValidBackendType(backendType)) {
LOGE("Invalid backend type(%d).", backendType);
ret = MEDIA_VISION_ERROR_INVALID_PARAMETER;
- goto release_model_meta_file_path;
+ goto release_model_user_file_path;
}
if (access(modelWeightFilePath, F_OK)) {
LOGE("weightFilePath in [%s] ", modelWeightFilePath);
ret = MEDIA_VISION_ERROR_INVALID_PATH;
- goto release_model_meta_file_path;
+ goto release_model_user_file_path;
}
if (IsConfigFilePathRequired(pInfer->GetTargetType(), backendType)) {
if (access(modelConfigFilePath, F_OK)) {
LOGE("modelConfigFilePath in [%s] ", modelConfigFilePath);
ret = MEDIA_VISION_ERROR_INVALID_PATH;
- goto release_model_meta_file_path;
+ goto release_model_user_file_path;
}
}
if (userFileLength > 0 && access(modelUserFilePath, F_OK)) {
LOGE("categoryFilePath in [%s] ", modelUserFilePath);
ret = MEDIA_VISION_ERROR_INVALID_PATH;
- goto release_model_meta_file_path;
+ goto release_model_user_file_path;
}
pInfer->ConfigureModelFiles(std::string(modelConfigFilePath),
std::string(modelWeightFilePath),
std::string(modelUserFilePath));
+ ret = mv_engine_config_get_string_attribute(
+ engine_config, MV_INFERENCE_MODEL_META_FILE_PATH,
+ &modelMetaFilePath);
+ if (ret != MEDIA_VISION_ERROR_NONE) {
+ LOGE("Fail to get model meta file path");
+ goto release_model_user_file_path;
+ }
+
if (std::string(modelMetaFilePath).empty()) {
LOGW("Skip ParseMetadata and run without Metadata");
goto release_model_meta_file_path;