Merge pull request #385 from szad670401/feature/ios_adapter
Feature/ios adapter
This commit is contained in:
@@ -679,10 +679,15 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)",
|
"$(PROJECT_DIR)",
|
||||||
);
|
);
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"INFERENCE_HELPER_ENABLE_MNN=1",
|
||||||
|
"IOS_CPU_FORWARD=1",
|
||||||
|
);
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../cpp/src";
|
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../cpp/src";
|
||||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
@@ -713,10 +718,15 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"$(PROJECT_DIR)",
|
"$(PROJECT_DIR)",
|
||||||
);
|
);
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"INFERENCE_HELPER_ENABLE_MNN=1",
|
||||||
|
"IOS_CPU_FORWARD=1",
|
||||||
|
);
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../cpp/src";
|
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../cpp/src";
|
||||||
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
INFOPLIST_KEY_NSHumanReadableCopyright = "";
|
||||||
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -43,9 +43,9 @@ void CameraBuffer::SetDataFormat(DATA_FORMAT data_format) {
|
|||||||
if (data_format == BGRA) {
|
if (data_format == BGRA) {
|
||||||
config_.sourceFormat = MNN::CV::BGRA;
|
config_.sourceFormat = MNN::CV::BGRA;
|
||||||
}
|
}
|
||||||
if (data_format == YCrCb) {
|
// if (data_format == YCrCb) {
|
||||||
config_.sourceFormat = MNN::CV::YCrCb;
|
// config_.sourceFormat = MNN::CV::YCrCb;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
cv::Mat CameraBuffer::GetAffineRGBImage(const cv::Mat &affine_matrix, const int width_out, const int height_out) const {
|
cv::Mat CameraBuffer::GetAffineRGBImage(const cv::Mat &affine_matrix, const int width_out, const int height_out) const {
|
||||||
@@ -233,4 +233,4 @@ int CameraBuffer::GetRotationMode() const{
|
|||||||
return rotation_mode_;
|
return rotation_mode_;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ void HyperLPRContext::operator()(CameraBuffer &buffer) {
|
|||||||
obj.type = type;
|
obj.type = type;
|
||||||
|
|
||||||
strcpy(obj.code, text_line.code.c_str());
|
strcpy(obj.code, text_line.code.c_str());
|
||||||
|
// printf("%s\n", obj.code);
|
||||||
// obj.code = text_line.code;
|
// obj.code = text_line.code;
|
||||||
|
|
||||||
// cv::imshow("align_image_pad", align_image_pad);
|
// cv::imshow("align_image_pad", align_image_pad);
|
||||||
|
|||||||
@@ -176,7 +176,12 @@ int32_t InferenceHelperMnn::Initialize(const std::string& model_filename, std::v
|
|||||||
}
|
}
|
||||||
|
|
||||||
MNN::ScheduleConfig scheduleConfig;
|
MNN::ScheduleConfig scheduleConfig;
|
||||||
|
#ifdef IOS_CPU_FORWARD
|
||||||
|
PRINT("ios use cpu backend.");
|
||||||
|
scheduleConfig.type = MNN_FORWARD_CPU;
|
||||||
|
#else
|
||||||
scheduleConfig.type = MNN_FORWARD_AUTO;
|
scheduleConfig.type = MNN_FORWARD_AUTO;
|
||||||
|
#endif
|
||||||
scheduleConfig.numThread = num_threads_; // it seems, setting 1 has better performance on Android
|
scheduleConfig.numThread = num_threads_; // it seems, setting 1 has better performance on Android
|
||||||
// MNN::BackendConfig bnconfig;
|
// MNN::BackendConfig bnconfig;
|
||||||
// bnconfig.power = MNN::BackendConfig::Power_High;
|
// bnconfig.power = MNN::BackendConfig::Power_High;
|
||||||
|
|||||||
Reference in New Issue
Block a user