paddleocr notes (1)

Reference: C++ compile PaddleOCR (CPU version)

Since paddle's c++ library with GPU is too big to get started, we start with the CPU library.

The basic steps are to follow the reference blog.

The difference: I didn't directly use vs2019 to directly compile CMake, but the previous experience of using cmake, because I don't like configuring many environment variables.

Create a new build folder directly in the PaddleOCR\deploy\cpp_infer directory, and start powershell under the build folder

cmake-gui ..

Then configure opencv path, cuda path, cudnn path, paddlelib path in cmake-gui, because it is a CPU library, there is no need to configure tensorrt.

Then set the installation path. The default installation path is on the c drive. This is something I can't bear. I am forced to change to a new install path under the build path.

Then use vs2019 to open the project and compile it once, indicating: I have changed the encoding format of main.cpp to utf-8-BOM before, otherwise an error will be prompted.

Normal display of Chinese under win10 needs to modify the ppocr_keys_v1.txt encoding format, the original format utf-8 is modified to ANSI encoding.

Recognition result:

C:\Users\Administrator\Desktop\paddleocr>ocr_system.exe .\tools\config.txt test1.jpg
=======Paddle OCR inference config======
char_list_file : ./model/ppocr_keys_v1.txt
cls_model_dir : ./model/cls
cls_thresh : 0.9
cpu_math_library_num_threads : 0
det_db_box_thresh : 0.5
det_db_thresh : 0.3
det_db_unclip_ratio : 1.6
det_model_dir : ./model/ch_det_mv3_db
gpu_id : 0
gpu_mem : 4000
max_side_len : 480
rec_model_dir : ./model/ch_rec_mv3_crnn
use_angle_cls : 0
use_gpu : 0
use_mkldnn : 1
use_zero_copy_run : 1
visualize : 1
=======End of Paddle OCR inference config======
e[37m---    fused 0 scale with matmule[0m
e[37m---    Fused 0 MatmulTransposeReshape patternse[0m
e[37m---    fused 0 scale with matmule[0m
e[37m---    Fused 0 MatmulTransposeReshape patternse[0m
The detection visualized image saved in ./ocr_vis.png
The predicted text is :
1       香升    score: 0.270926
2       梅花香自苦家来。        score: 0.720717
3       宝剑锋从磨砺出  score: 0.799821
花费了0.256668秒

 

 

 

 

Guess you like

Origin blog.csdn.net/juluwangriyue/article/details/108877013