From 4274652a34b746e81b7fa50500fe7902c890da97 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Wed, 15 Jul 2020 21:05:29 +0800 Subject: [PATCH] Support to recognize space text --- deploy/lite/ocr_db_crnn.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/deploy/lite/ocr_db_crnn.cc b/deploy/lite/ocr_db_crnn.cc index 547afbf0..c94062fd 100644 --- a/deploy/lite/ocr_db_crnn.cc +++ b/deploy/lite/ocr_db_crnn.cc @@ -235,9 +235,9 @@ RunDetModel(std::shared_ptr predictor, cv::Mat img, } cv::Mat cbuf_map(shape_out[2], shape_out[3], CV_8UC1, - reinterpret_cast cbuf); + reinterpret_cast(cbuf)); cv::Mat pred_map(shape_out[2], shape_out[3], CV_32F, - reinterpret_cast pred); + reinterpret_cast(pred)); const double threshold = double(Config["det_db_thresh"]) * 255; const double maxvalue = 255; @@ -335,6 +335,7 @@ int main(int argc, char **argv) { auto rec_predictor = loadModel(rec_model_file); auto charactor_dict = ReadDict(dict_path); + charactor_dict.push_back(" "); cv::Mat srcimg = cv::imread(img_path, cv::IMREAD_COLOR); auto boxes = RunDetModel(det_predictor, srcimg, Config); -- GitLab