Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
7be68dbd
P
PaddleOCR
项目概览
PaddlePaddle
/
PaddleOCR
大约 1 年 前同步成功
通知
1528
Star
32962
Fork
6643
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
108
列表
看板
标记
里程碑
合并请求
7
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
108
Issue
108
列表
看板
标记
里程碑
合并请求
7
合并请求
7
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7be68dbd
编写于
9月 08, 2021
作者:
M
MissPenguin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix readme
上级
96e1ce3d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
22 deletion
+32
-22
tests/readme.md
tests/readme.md
+28
-18
tests/test.sh
tests/test.sh
+4
-4
未找到文件。
tests/readme.md
浏览文件 @
7be68dbd
...
@@ -23,36 +23,46 @@ test.sh和params.txt文件配合使用,完成OCR轻量检测和识别模型从
...
@@ -23,36 +23,46 @@ test.sh和params.txt文件配合使用,完成OCR轻量检测和识别模型从
```
bash
```
bash
tests/
tests/
├── ocr_det_params.txt
# 测试OCR检测模型的参数配置文件
├── ocr_det_params.txt
# 测试OCR检测模型的参数配置文件
├── ocr_rec_params.txt
# 测试OCR识别模型的参数配置文件
├── ocr_rec_params.txt
# 测试OCR识别模型的参数配置文件
└── prepare.sh
# 完成test.sh运行所需要的数据和模型下载
├── ocr_ppocr_mobile_params.txt
# 测试OCR检测+识别模型串联的参数配置文件
└── test.sh
# 根据
└── prepare.sh
# 完成test.sh运行所需要的数据和模型下载
└── test.sh
# 测试主程序
```
```
# 使用方法
# 使用方法
test.sh包含四种运行模式,每种模式的运行数据不同,分别用于测试速度和精度,分别是:
test.sh包含四种运行模式,每种模式的运行数据不同,分别用于测试速度和精度,分别是:
-
模式1 lite_train_infer,使用少量数据训练,用于快速验证训练到预测的走通流程,不验证精度和速度;
```
-
模式1:lite_train_infer,使用少量数据训练,用于快速验证训练到预测的走通流程,不验证精度和速度;
```
shell
bash
test
/prepare.sh ./tests/ocr_det_params.txt
'lite_train_infer'
bash
test
/prepare.sh ./tests/ocr_det_params.txt
'lite_train_infer'
bash tests/test.sh ./tests/ocr_det_params.txt
'lite_train_infer'
bash tests/test.sh ./tests/ocr_det_params.txt
'lite_train_infer'
```
```
-
模式2 whole_infer,使用少量数据训练,一定量数据预测,用于验证训练后的模型执行预测,预测速度是否合理;
```
-
模式2:whole_infer,使用少量数据训练,一定量数据预测,用于验证训练后的模型执行预测,预测速度是否合理;
```
shell
bash tests/prepare.sh ./tests/ocr_det_params.txt
'whole_infer'
bash tests/prepare.sh ./tests/ocr_det_params.txt
'whole_infer'
bash tests/test.sh ./tests/ocr_det_params.txt
'whole_infer'
bash tests/test.sh ./tests/ocr_det_params.txt
'whole_infer'
```
```
-
模式3
infer 不训练,全量数据预测,走通开源模型评估、动转静,检查inference model预测时间和精度;
-
模式3
:
infer 不训练,全量数据预测,走通开源模型评估、动转静,检查inference model预测时间和精度;
```
```
shell
bash tests/prepare.sh ./tests/ocr_det_params.txt
'infer'
bash tests/prepare.sh ./tests/ocr_det_params.txt
'infer'
用法1:
#
用法1:
bash tests/test.sh ./tests/ocr_det_params.txt
'infer'
bash tests/test.sh ./tests/ocr_det_params.txt
'infer'
用法2: 指定GPU卡预测,第三个传入参数为GPU卡号
#
用法2: 指定GPU卡预测,第三个传入参数为GPU卡号
bash tests/test.sh ./tests/ocr_det_params.txt
'infer'
'1'
bash tests/test.sh ./tests/ocr_det_params.txt
'infer'
'1'
```
```
模式4: whole_train_infer , CE: 全量数据训练,全量数据预测,验证模型训练精度,预测精度,预测速度
-
模式4:whole_train_infer , CE: 全量数据训练,全量数据预测,验证模型训练精度,预测精度,预测速度;
```
```
shell
bash tests/prepare.sh ./tests/ocr_det_params.txt
'whole_train_infer'
bash tests/prepare.sh ./tests/ocr_det_params.txt
'whole_train_infer'
bash tests/test.sh ./tests/ocr_det_params.txt
'whole_train_infer'
bash tests/test.sh ./tests/ocr_det_params.txt
'whole_train_infer'
```
```
-
模式5:cpp_infer , CE: 验证inference model的c++预测是否走通;
```
shell
bash tests/prepare.sh ./tests/ocr_det_params.txt
'cpp_infer'
bash tests/test.sh ./tests/ocr_det_params.txt
'cpp_infer'
```
tests/test.sh
浏览文件 @
7be68dbd
...
@@ -192,8 +192,8 @@ if [ ${MODE} = "cpp_infer" ]; then
...
@@ -192,8 +192,8 @@ if [ ${MODE} = "cpp_infer" ]; then
cpp_infer_model_key
=
$(
func_parser_key
"
${
lines
[62]
}
"
)
cpp_infer_model_key
=
$(
func_parser_key
"
${
lines
[62]
}
"
)
cpp_image_dir_key
=
$(
func_parser_key
"
${
lines
[63]
}
"
)
cpp_image_dir_key
=
$(
func_parser_key
"
${
lines
[63]
}
"
)
cpp_infer_img_dir
=
$(
func_parser_value
"
${
lines
[63]
}
"
)
cpp_infer_img_dir
=
$(
func_parser_value
"
${
lines
[63]
}
"
)
cpp_
rec_model_key
=
$(
func_parser_key
"
${
lines
[64]
}
"
)
cpp_
infer_key1
=
$(
func_parser_key
"
${
lines
[64]
}
"
)
cpp_
rec_model_value
=
$(
func_parser_value
"
${
lines
[64]
}
"
)
cpp_
infer_value1
=
$(
func_parser_value
"
${
lines
[64]
}
"
)
cpp_benchmark_key
=
$(
func_parser_key
"
${
lines
[65]
}
"
)
cpp_benchmark_key
=
$(
func_parser_key
"
${
lines
[65]
}
"
)
cpp_benchmark_value
=
$(
func_parser_value
"
${
lines
[65]
}
"
)
cpp_benchmark_value
=
$(
func_parser_value
"
${
lines
[65]
}
"
)
fi
fi
...
@@ -369,7 +369,7 @@ function func_cpp_inference(){
...
@@ -369,7 +369,7 @@ function func_cpp_inference(){
set_batchsize
=
$(
func_set_params
"
${
cpp_batch_size_key
}
"
"
${
batch_size
}
"
)
set_batchsize
=
$(
func_set_params
"
${
cpp_batch_size_key
}
"
"
${
batch_size
}
"
)
set_cpu_threads
=
$(
func_set_params
"
${
cpp_cpu_threads_key
}
"
"
${
threads
}
"
)
set_cpu_threads
=
$(
func_set_params
"
${
cpp_cpu_threads_key
}
"
"
${
threads
}
"
)
set_model_dir
=
$(
func_set_params
"
${
cpp_infer_model_key
}
"
"
${
_model_dir
}
"
)
set_model_dir
=
$(
func_set_params
"
${
cpp_infer_model_key
}
"
"
${
_model_dir
}
"
)
set_infer_params1
=
$(
func_set_params
"
${
cpp_
rec_model_key
}
"
"
${
cpp_rec_model_value
}
"
)
set_infer_params1
=
$(
func_set_params
"
${
cpp_
infer_key1
}
"
"
${
cpp_infer_value1
}
"
)
command
=
"
${
_script
}
${
cpp_use_gpu_key
}
=
${
use_gpu
}
${
cpp_use_mkldnn_key
}
=
${
use_mkldnn
}
${
set_cpu_threads
}
${
set_model_dir
}
${
set_batchsize
}
${
set_infer_data
}
${
set_benchmark
}
${
set_infer_params1
}
>
${
_save_log_path
}
2>&1 "
command
=
"
${
_script
}
${
cpp_use_gpu_key
}
=
${
use_gpu
}
${
cpp_use_mkldnn_key
}
=
${
use_mkldnn
}
${
set_cpu_threads
}
${
set_model_dir
}
${
set_batchsize
}
${
set_infer_data
}
${
set_benchmark
}
${
set_infer_params1
}
>
${
_save_log_path
}
2>&1 "
eval
$command
eval
$command
last_status
=
${
PIPESTATUS
[0]
}
last_status
=
${
PIPESTATUS
[0]
}
...
@@ -398,7 +398,7 @@ function func_cpp_inference(){
...
@@ -398,7 +398,7 @@ function func_cpp_inference(){
set_tensorrt
=
$(
func_set_params
"
${
cpp_use_trt_key
}
"
"
${
use_trt
}
"
)
set_tensorrt
=
$(
func_set_params
"
${
cpp_use_trt_key
}
"
"
${
use_trt
}
"
)
set_precision
=
$(
func_set_params
"
${
cpp_precision_key
}
"
"
${
precision
}
"
)
set_precision
=
$(
func_set_params
"
${
cpp_precision_key
}
"
"
${
precision
}
"
)
set_model_dir
=
$(
func_set_params
"
${
cpp_infer_model_key
}
"
"
${
_model_dir
}
"
)
set_model_dir
=
$(
func_set_params
"
${
cpp_infer_model_key
}
"
"
${
_model_dir
}
"
)
set_infer_params1
=
$(
func_set_params
"
${
cpp_
rec_model_key
}
"
"
${
cpp_rec_model_value
}
"
)
set_infer_params1
=
$(
func_set_params
"
${
cpp_
infer_key1
}
"
"
${
cpp_infer_value1
}
"
)
command
=
"
${
_script
}
${
cpp_use_gpu_key
}
=
${
use_gpu
}
${
set_tensorrt
}
${
set_precision
}
${
set_model_dir
}
${
set_batchsize
}
${
set_infer_data
}
${
set_benchmark
}
${
set_infer_params1
}
>
${
_save_log_path
}
2>&1 "
command
=
"
${
_script
}
${
cpp_use_gpu_key
}
=
${
use_gpu
}
${
set_tensorrt
}
${
set_precision
}
${
set_model_dir
}
${
set_batchsize
}
${
set_infer_data
}
${
set_benchmark
}
${
set_infer_params1
}
>
${
_save_log_path
}
2>&1 "
eval
$command
eval
$command
last_status
=
${
PIPESTATUS
[0]
}
last_status
=
${
PIPESTATUS
[0]
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录