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 d720066667b60ee87bc1a1227ad720074254074e..e7de9b0b1c7c228ba7e00ad912cdfedcce7812a1 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 0ec458a4952cbc605e9979ce7850bdeab36c4629..588f25cb0662b6cc5c8677549e7eb3527d74fa9b 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 f522e4bc5a9050c981a91bcbd8dfefd719f034c2..9f5c3e9406cfe82fd1ded523d88890b6448ad5f1 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 07bec2c6f8fc02936b6c69d472984735c7b541cb..91cd07e7c7fdfebabe9dfa66ad481125d5aa8f9a 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};