char *modelUserFilePath = NULL;
double modelMeanValue = 0.0;
int backendType = 0;
- int targetTypes = 0;
size_t userFileLength = 0;
ret = mv_engine_config_get_string_attribute(
goto _ERROR_;
}
- ret = mv_engine_config_get_int_attribute(
- engine_config, MV_INFERENCE_TARGET_DEVICE_TYPE, &targetTypes);
- if (ret != MEDIA_VISION_ERROR_NONE) {
- LOGE("Fail to get inference target type");
- goto _ERROR_;
- }
-
if (access(modelWeightFilePath, F_OK)) {
LOGE("weightFilePath in [%s] ", modelWeightFilePath);
ret = MEDIA_VISION_ERROR_INVALID_PATH;
goto _ERROR_;
}
- bool is_new_version;
-
- // Check if new inference engine framework or old one.
- // new inference engine framework has different mv_inference_target_type_e enumeration values
- // to support multiple inference target devices. So in case of old version,
- // enumeration value given by user should be converted to new value, which
- // will be done at ConfigureTargetTypes callback internally.
- // Ps. this function will be dropped with deprecated code version-after-next of Tizen.
- ret = check_mv_inference_engine_version(engine_config, &is_new_version);
- if (ret != MEDIA_VISION_ERROR_NONE)
- goto _ERROR_;
-
- if (is_new_version) {
- // Use new type.
- if (pInfer->ConfigureTargetDevices(targetTypes) !=
- MEDIA_VISION_ERROR_NONE) {
- LOGE("Tried to configure invalid target types.");
- goto _ERROR_;
- }
- } else {
- // Convert old type to new one and then use it.
- if (pInfer->ConfigureTargetTypes(targetTypes) !=
- MEDIA_VISION_ERROR_NONE) {
- LOGE("Tried to configure invalid target types.");
- goto _ERROR_;
- }
- }
-
pInfer->ConfigureModelFiles(std::string(modelConfigFilePath),
std::string(modelWeightFilePath),
std::string(modelUserFilePath));
Inference *pInfer = static_cast<Inference *>(infer);
int backendType = 0;
+ int targetTypes = 0;
int ret = MEDIA_VISION_ERROR_NONE;
pInfer->SetEngineConfig(engine_config);
goto _ERROR_;
}
+ ret = mv_engine_config_get_int_attribute(
+ engine_config, MV_INFERENCE_TARGET_DEVICE_TYPE, &targetTypes);
+ if (ret != MEDIA_VISION_ERROR_NONE) {
+ LOGE("Fail to get inference target type");
+ goto _ERROR_;
+ }
+
ret = pInfer->ConfigureBackendType(
(mv_inference_backend_type_e) backendType);
if (ret != MEDIA_VISION_ERROR_NONE) {
goto _ERROR_;
}
+ bool is_new_version;
+
+ // Check if new inference engine framework or old one.
+ // new inference engine framework has different mv_inference_target_type_e enumeration values
+ // to support multiple inference target devices. So in case of old version,
+ // enumeration value given by user should be converted to new value, which
+ // will be done at ConfigureTargetTypes callback internally.
+ // Ps. this function will be dropped with deprecated code version-after-next of Tizen.
+ ret = check_mv_inference_engine_version(engine_config, &is_new_version);
+ if (ret != MEDIA_VISION_ERROR_NONE)
+ goto _ERROR_;
+
+ if (is_new_version) {
+ // Use new type.
+ if (pInfer->ConfigureTargetDevices(targetTypes) !=
+ MEDIA_VISION_ERROR_NONE) {
+ LOGE("Tried to configure invalid target types.");
+ goto _ERROR_;
+ }
+ } else {
+ // Convert old type to new one and then use it.
+ if (pInfer->ConfigureTargetTypes(targetTypes) !=
+ MEDIA_VISION_ERROR_NONE) {
+ LOGE("Tried to configure invalid target types.");
+ goto _ERROR_;
+ }
+ }
+
// Create a inference-engine-common class object and load its corresponding library.
ret = pInfer->Bind();
if (ret != MEDIA_VISION_ERROR_NONE) {