Fix iOS forward bug

This commit is contained in:
tunm
2023-09-03 23:08:40 +08:00
parent 0ce5566171
commit 6e43f0f426
4 changed files with 19 additions and 4 deletions
+4 -4
View File
@@ -43,9 +43,9 @@ void CameraBuffer::SetDataFormat(DATA_FORMAT data_format) {
if (data_format == BGRA) {
config_.sourceFormat = MNN::CV::BGRA;
}
if (data_format == YCrCb) {
config_.sourceFormat = MNN::CV::YCrCb;
}
// if (data_format == YCrCb) {
// config_.sourceFormat = MNN::CV::YCrCb;
// }
}
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_;
}
}
}
@@ -176,7 +176,12 @@ int32_t InferenceHelperMnn::Initialize(const std::string& model_filename, std::v
}
MNN::ScheduleConfig scheduleConfig;
#ifdef IOS_CPU_FORWARD
PRINT("ios use cpu backend.");
scheduleConfig.type = MNN_FORWARD_CPU;
#else
scheduleConfig.type = MNN_FORWARD_AUTO;
#endif
scheduleConfig.numThread = num_threads_; // it seems, setting 1 has better performance on Android
// MNN::BackendConfig bnconfig;
// bnconfig.power = MNN::BackendConfig::Power_High;