Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wangsen
paddle_dbnet
Commits
6fc43d4b
Commit
6fc43d4b
authored
Feb 01, 2021
by
WenmuZhou
Browse files
change model to inference modem
parent
98ea0779
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
21 deletions
+21
-21
deploy/lite/readme.md
deploy/lite/readme.md
+11
-11
deploy/lite/readme_en.md
deploy/lite/readme_en.md
+10
-10
No files found.
deploy/lite/readme.md
View file @
6fc43d4b
...
@@ -123,15 +123,15 @@ cd build.opt/lite/api/
...
@@ -123,15 +123,15 @@ cd build.opt/lite/api/
```
```
# 【推荐】 下载PaddleOCR V2.0版本的中英文 inference模型
# 【推荐】 下载PaddleOCR V2.0版本的中英文 inference模型
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_
slim_
infer.tar && tar xf ch_ppocr_mobile_v2.0_det_
slim_
infer.tar
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_ppocr_mobile_v2.0_det_infer.tar
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_
slim_
infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_
slim_
infer.tar
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_
slim_
infer.tar && tar xf ch_ppocr_mobile_v2.0_cls_
slim_
infer.tar
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar && tar xf ch_ppocr_mobile_v2.0_cls_infer.tar
# 转换V2.0检测模型
# 转换V2.0检测模型
./opt --model_file=./ch_ppocr_mobile_v2.0_det_
slim_
infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_det_
slim_
infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_det_
slim_
opt --valid_targets=arm --optimize_out_type=naive_buffer
./opt --model_file=./ch_ppocr_mobile_v2.0_det_infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_det_infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_det_opt --valid_targets=arm --optimize_out_type=naive_buffer
# 转换V2.0识别模型
# 转换V2.0识别模型
./opt --model_file=./ch_ppocr_mobile_v2.0_rec_
slim_
infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_rec_
slim_
infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_rec_
slim_
opt --valid_targets=arm --optimize_out_type=naive_buffer
./opt --model_file=./ch_ppocr_mobile_v2.0_rec_infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_rec_infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_rec_opt --valid_targets=arm --optimize_out_type=naive_buffer
# 转换V2.0方向分类器模型
# 转换V2.0方向分类器模型
./opt --model_file=./ch_ppocr_mobile_v2.0_cls_
slim_
infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_cls_
slim_
infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_cls_
slim_
opt --valid_targets=arm --optimize_out_type=naive_buffer
./opt --model_file=./ch_ppocr_mobile_v2.0_cls_infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_cls_infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_cls_opt --valid_targets=arm --optimize_out_type=naive_buffer
```
```
...
@@ -185,16 +185,16 @@ wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_s
...
@@ -185,16 +185,16 @@ wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_s
```
```
准备测试图像,以
`PaddleOCR/doc/imgs/11.jpg`
为例,将测试的图像复制到
`demo/cxx/ocr/debug/`
文件夹下。
准备测试图像,以
`PaddleOCR/doc/imgs/11.jpg`
为例,将测试的图像复制到
`demo/cxx/ocr/debug/`
文件夹下。
准备lite opt工具优化后的模型文件,比如使用
`ch_ppocr_mobile_v2.0_det_
slim_
opt.nb,ch_ppocr_mobile_v2.0_rec_
slim_
opt.nb, ch_ppocr_mobile_v2.0_cls_
slim_
opt.nb`
,模型文件放置在
`demo/cxx/ocr/debug/`
文件夹下。
准备lite opt工具优化后的模型文件,比如使用
`ch_ppocr_mobile_v2.0_det_opt.nb,ch_ppocr_mobile_v2.0_rec_opt.nb, ch_ppocr_mobile_v2.0_cls_opt.nb`
,模型文件放置在
`demo/cxx/ocr/debug/`
文件夹下。
执行完成后,ocr文件夹下将有如下文件格式:
执行完成后,ocr文件夹下将有如下文件格式:
```
```
demo/cxx/ocr/
demo/cxx/ocr/
|-- debug/
|-- debug/
| |--ch_ppocr_mobile_v2.0_det_
slim_
opt.nb 优化后的检测模型文件
| |--ch_ppocr_mobile_v2.0_det_opt.nb 优化后的检测模型文件
| |--ch_ppocr_mobile_v2.0_rec_
slim_
opt.nb 优化后的识别模型文件
| |--ch_ppocr_mobile_v2.0_rec_opt.nb 优化后的识别模型文件
| |--ch_ppocr_mobile_v2.0_cls_
slim_
opt.nb 优化后的文字方向分类器模型文件
| |--ch_ppocr_mobile_v2.0_cls_opt.nb 优化后的文字方向分类器模型文件
| |--11.jpg 待测试图像
| |--11.jpg 待测试图像
| |--ppocr_keys_v1.txt 中文字典文件
| |--ppocr_keys_v1.txt 中文字典文件
| |--libpaddle_light_api_shared.so C++预测库文件
| |--libpaddle_light_api_shared.so C++预测库文件
...
@@ -248,7 +248,7 @@ use_direction_classify 0 # 是否使用方向分类器,0表示不使用,1
...
@@ -248,7 +248,7 @@ use_direction_classify 0 # 是否使用方向分类器,0表示不使用,1
adb shell
adb shell
cd /data/local/tmp/debug
cd /data/local/tmp/debug
export LD_LIBRARY_PATH=${PWD}:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${PWD}:$LD_LIBRARY_PATH
./ocr_db_crnn ch_ppocr_mobile_v2.0_det_
slim_
opt.nbb ch_ppocr_mobile_v2.0_rec_
slim_
opt.nb ch_ppocr_mobile_v2.0_cls_
slim_
opt.nb ./11.jpg ppocr_keys_v1.txt
./ocr_db_crnn ch_ppocr_mobile_v2.0_det_opt.nbb ch_ppocr_mobile_v2.0_rec_opt.nb ch_ppocr_mobile_v2.0_cls_opt.nb ./11.jpg ppocr_keys_v1.txt
```
```
如果对代码做了修改,则需要重新编译并push到手机上。
如果对代码做了修改,则需要重新编译并push到手机上。
...
...
deploy/lite/readme_en.md
View file @
6fc43d4b
...
@@ -124,16 +124,16 @@ The following takes the ultra-lightweight Chinese model of PaddleOCR as an examp
...
@@ -124,16 +124,16 @@ The following takes the ultra-lightweight Chinese model of PaddleOCR as an examp
```
```
# [Recommendation] Download the Chinese and English inference model of PaddleOCR V2.0
# [Recommendation] Download the Chinese and English inference model of PaddleOCR V2.0
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_
slim_
infer.tar && tar xf ch_ppocr_mobile_v2.0_det_
slim_
infer.tar
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar && tar xf ch_ppocr_mobile_v2.0_det_infer.tar
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_
slim_
infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_
slim_
infer.tar
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_infer.tar && tar xf ch_ppocr_mobile_v2.0_rec_infer.tar
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_
slim_
infer.tar && tar xf ch_ppocr_mobile_v2.0_cls_
slim_
infer.tar
wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar && tar xf ch_ppocr_mobile_v2.0_cls_infer.tar
# Convert V2.0 detection model
# Convert V2.0 detection model
./opt --model_file=./ch_ppocr_mobile_v2.0_det_
slim_
infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_det_
slim_
infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_det_
slim_
opt --valid_targets=arm --optimize_out_type=naive_buffer
./opt --model_file=./ch_ppocr_mobile_v2.0_det_infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_det_infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_det_opt --valid_targets=arm --optimize_out_type=naive_buffer
# 转换V2.0识别模型
# 转换V2.0识别模型
# Convert V2.0 recognition model
# Convert V2.0 recognition model
./opt --model_file=./ch_ppocr_mobile_v2.0_rec_
slim_
infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_rec_
slim_
infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_rec_
slim_
opt --valid_targets=arm --optimize_out_type=naive_buffer
./opt --model_file=./ch_ppocr_mobile_v2.0_rec_infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_rec_infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_rec_opt --valid_targets=arm --optimize_out_type=naive_buffer
# Convert V2.0 angle classifier model
# Convert V2.0 angle classifier model
./opt --model_file=./ch_ppocr_mobile_v2.0_cls_
slim_
infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_cls_
slim_
infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_cls_
slim_
opt --valid_targets=arm --optimize_out_type=naive_buffer
./opt --model_file=./ch_ppocr_mobile_v2.0_cls_infer/inference.pdmodel --param_file=./ch_ppocr_mobile_v2.0_cls_infer/inference.pdiparams --optimize_out=./ch_ppocr_mobile_v2.0_cls_opt --valid_targets=arm --optimize_out_type=naive_buffer
```
```
...
@@ -194,9 +194,9 @@ The structure of the OCR demo is as follows after the above command is executed:
...
@@ -194,9 +194,9 @@ The structure of the OCR demo is as follows after the above command is executed:
```
```
demo/cxx/ocr/
demo/cxx/ocr/
|-- debug/
|-- debug/
| |--ch_ppocr_mobile_v2.0_det_
slim_
opt.nb Detection model
| |--ch_ppocr_mobile_v2.0_det_opt.nb Detection model
| |--ch_ppocr_mobile_v2.0_rec_
slim_
opt.nb Recognition model
| |--ch_ppocr_mobile_v2.0_rec_opt.nb Recognition model
| |--ch_ppocr_mobile_v2.0_cls_
slim_
opt.nb Text direction classification model
| |--ch_ppocr_mobile_v2.0_cls_opt.nb Text direction classification model
| |--11.jpg Image for OCR
| |--11.jpg Image for OCR
| |--ppocr_keys_v1.txt Dictionary file
| |--ppocr_keys_v1.txt Dictionary file
| |--libpaddle_light_api_shared.so C++ .so file
| |--libpaddle_light_api_shared.so C++ .so file
...
@@ -248,7 +248,7 @@ After the above steps are completed, you can use adb to push the file to the pho
...
@@ -248,7 +248,7 @@ After the above steps are completed, you can use adb to push the file to the pho
adb shell
adb shell
cd /data/local/tmp/debug
cd /data/local/tmp/debug
export LD_LIBRARY_PATH=${PWD}:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${PWD}:$LD_LIBRARY_PATH
./ocr_db_crnn ch_ppocr_mobile_v2.0_det_
slim_
opt.nbb ch_ppocr_mobile_v2.0_rec_
slim_
opt.nb ch_ppocr_mobile_v2.0_cls_
slim_
opt.nb ./11.jpg ppocr_keys_v1.txt
./ocr_db_crnn ch_ppocr_mobile_v2.0_det_opt.nbb ch_ppocr_mobile_v2.0_rec_opt.nb ch_ppocr_mobile_v2.0_cls_opt.nb ./11.jpg ppocr_keys_v1.txt
```
```
If you modify the code, you need to recompile and push to the phone.
If you modify the code, you need to recompile and push to the phone.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment