diff --git a/deploy/android_demo/app/src/main/cpp/ocr_cls_process.cpp b/deploy/android_demo/app/src/main/cpp/ocr_cls_process.cpp index d7200666..e7de9b0b 100644 --- a/deploy/android_demo/app/src/main/cpp/ocr_cls_process.cpp +++ b/deploy/android_demo/app/src/main/cpp/ocr_cls_process.cpp @@ -20,7 +20,7 @@ #include #include -const std::vector CLS_IMAGE_SHAPE = {3, 32, 100}; +const std::vector CLS_IMAGE_SHAPE = {3, 48, 192}; cv::Mat cls_resize_img(const cv::Mat &img) { int imgC = CLS_IMAGE_SHAPE[0]; diff --git a/deploy/android_demo/app/src/main/cpp/ocr_ppredictor.h b/deploy/android_demo/app/src/main/cpp/ocr_ppredictor.h index 0ec458a4..588f25cb 100644 --- a/deploy/android_demo/app/src/main/cpp/ocr_ppredictor.h +++ b/deploy/android_demo/app/src/main/cpp/ocr_ppredictor.h @@ -98,7 +98,7 @@ private: * @param origin * @return */ - cv::Mat infer_cls(const cv::Mat &origin, float thresh = 0.5); + cv::Mat infer_cls(const cv::Mat &origin, float thresh = 0.9); /** * Postprocess or sencod model to extract text diff --git a/deploy/lite/cls_process.cc b/deploy/lite/cls_process.cc index f522e4bc..9f5c3e94 100644 --- a/deploy/lite/cls_process.cc +++ b/deploy/lite/cls_process.cc @@ -17,7 +17,7 @@ #include #include -const std::vector rec_image_shape{3, 32, 100}; +const std::vector rec_image_shape{3, 48, 192}; cv::Mat ClsResizeImg(cv::Mat img) { int imgC, imgH, imgW; diff --git a/deploy/lite/ocr_db_crnn.cc b/deploy/lite/ocr_db_crnn.cc index f3c43ebd..cc06ce86 100644 --- a/deploy/lite/ocr_db_crnn.cc +++ b/deploy/lite/ocr_db_crnn.cc @@ -107,7 +107,7 @@ cv::Mat DetResizeImg(const cv::Mat img, int max_size_len, } cv::Mat RunClsModel(cv::Mat img, std::shared_ptr predictor_cls, - const float thresh = 0.5) { + const float thresh = 0.9) { std::vector mean = {0.5f, 0.5f, 0.5f}; std::vector scale = {1 / 0.5f, 1 / 0.5f, 1 / 0.5f};