From ccd40ec85f77c1797df2e59012e3413c67c0d0c4 Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Fri, 25 Sep 2020 15:58:16 +0800 Subject: [PATCH] set cls image_shape to 3,48,192 --- deploy/android_demo/app/src/main/cpp/ocr_cls_process.cpp | 2 +- deploy/android_demo/app/src/main/cpp/ocr_ppredictor.h | 2 +- deploy/lite/cls_process.cc | 2 +- deploy/lite/ocr_db_crnn.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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 07bec2c6..91cd07e7 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}; -- GitLab