Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
499593c4
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
499593c4
编写于
10月 28, 2021
作者:
M
MissPenguin
提交者:
GitHub
10月 28, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4472 from LDOUBLEV/test_v10
rename tipc mode name
上级
0d8d6f21
ecf05975
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
26 deletion
+27
-26
test_tipc/docs/test_train_inference_python.md
test_tipc/docs/test_train_inference_python.md
+16
-16
test_tipc/prepare.sh
test_tipc/prepare.sh
+8
-7
test_tipc/test_train_inference_python.sh
test_tipc/test_train_inference_python.sh
+3
-3
未找到文件。
test_tipc/docs/test_train_inference_python.md
浏览文件 @
499593c4
...
...
@@ -51,37 +51,37 @@
`test_train_inference_python.sh`
包含5种运行模式,每种模式的运行数据不同,分别用于测试速度和精度,分别是:
-
模式1:lite_train_infer,使用少量数据训练,用于快速验证训练到预测的走通流程,不验证精度和速度;
-
模式1:lite_train_
lite_
infer,使用少量数据训练,用于快速验证训练到预测的走通流程,不验证精度和速度;
```
shell
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'lite_train_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'lite_train_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'lite_train_
lite_
infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'lite_train_
lite_
infer'
```
-
模式2:whole_infer,使用少量数据训练,一定量数据预测,用于验证训练后的模型执行预测,预测速度是否合理;
-
模式2:
lite_train_
whole_infer,使用少量数据训练,一定量数据预测,用于验证训练后的模型执行预测,预测速度是否合理;
```
shell
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'whole_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'
lite_train_
whole_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'
lite_train_
whole_infer'
```
-
模式3:infer,不训练,全量数据预测,走通开源模型评估、动转静,检查inference model预测时间和精度;
-
模式3:
whole_
infer,不训练,全量数据预测,走通开源模型评估、动转静,检查inference model预测时间和精度;
```
shell
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'
whole_
infer'
# 用法1:
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'
whole_
infer'
# 用法2: 指定GPU卡预测,第三个传入参数为GPU卡号
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'infer'
'1'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'
whole_
infer'
'1'
```
-
模式4:whole_train_infer,CE: 全量数据训练,全量数据预测,验证模型训练精度,预测精度,预测速度;
-
模式4:whole_train_
whole_
infer,CE: 全量数据训练,全量数据预测,验证模型训练精度,预测精度,预测速度;
```
shell
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'whole_train_infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'whole_train_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'whole_train_
whole_
infer'
bash test_tipc/test_train_inference_python.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'whole_train_
whole_
infer'
```
-
模式5:klquant_infer,测试离线量化;
-
模式5:klquant_
whole_
infer,测试离线量化;
```
shell
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'klquant_infer'
bash test_tipc/test_train_inference_python.sh test_tipc/configs/ppocr_det_mobile_params.txt
'klquant_infer'
bash test_tipc/prepare.sh ./test_tipc/configs/ppocr_det_mobile_params.txt
'klquant_
whole_
infer'
bash test_tipc/test_train_inference_python.sh test_tipc/configs/ppocr_det_mobile_params.txt
'klquant_
whole_
infer'
```
...
...
test_tipc/prepare.sh
浏览文件 @
499593c4
#!/bin/bash
FILENAME
=
$1
# MODE be one of ['lite_train_infer' 'whole_infer' 'whole_train_infer', 'infer',
# 'cpp_infer', 'serving_infer', 'klquant_infer', 'lite_infer']
# MODE be one of ['lite_train_lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer',
# 'whole_infer', 'klquant_whole_infer',
# 'cpp_infer', 'serving_infer', 'lite_infer']
MODE
=
$2
...
...
@@ -34,7 +35,7 @@ trainer_list=$(func_parser_value "${lines[14]}")
# MODE be one of ['lite_train_infer' 'whole_infer' 'whole_train_infer']
MODE
=
$2
if
[
${
MODE
}
=
"lite_train_infer"
]
;
then
if
[
${
MODE
}
=
"lite_train_
lite_
infer"
]
;
then
# pretrain lite train data
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar
...
...
@@ -50,14 +51,14 @@ if [ ${MODE} = "lite_train_infer" ];then
ln
-s
./icdar2015_lite ./icdar2015
cd
../
cd
./inference
&&
tar
xf rec_inference.tar
&&
cd
../
elif
[
${
MODE
}
=
"whole_train_infer"
]
;
then
elif
[
${
MODE
}
=
"whole_train_
whole_
infer"
]
;
then
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams
rm
-rf
./train_data/icdar2015
rm
-rf
./train_data/ic15_data
wget
-nc
-P
./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/icdar2015.tar
wget
-nc
-P
./train_data/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ic15_data.tar
cd
./train_data/
&&
tar
xf icdar2015.tar
&&
tar
xf ic15_data.tar
&&
cd
../
elif
[
${
MODE
}
=
"whole_infer"
]
;
then
elif
[
${
MODE
}
=
"
lite_train_
whole_infer"
]
;
then
wget
-nc
-P
./pretrain_models/ https://paddle-imagenet-models-name.bj.bcebos.com/dygraph/MobileNetV3_large_x0_5_pretrained.pdparams
rm
-rf
./train_data/icdar2015
rm
-rf
./train_data/ic15_data
...
...
@@ -66,7 +67,7 @@ elif [ ${MODE} = "whole_infer" ];then
cd
./train_data/
&&
tar
xf icdar2015_infer.tar
&&
tar
xf ic15_data.tar
ln
-s
./icdar2015_infer ./icdar2015
cd
../
elif
[
${
MODE
}
=
"infer"
]
;
then
elif
[
${
MODE
}
=
"
whole_
infer"
]
;
then
if
[
${
model_name
}
=
"ocr_det"
]
;
then
eval_model_name
=
"ch_ppocr_mobile_v2.0_det_train"
rm
-rf
./train_data/icdar2015
...
...
@@ -100,7 +101,7 @@ elif [ ${MODE} = "infer" ];then
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_rec_infer.tar
cd
./inference
&&
tar
xf
${
eval_model_name
}
.tar
&&
tar
xf rec_inference.tar
&&
cd
../
fi
elif
[
${
MODE
}
=
"klquant_infer"
]
;
then
elif
[
${
MODE
}
=
"klquant_
whole_
infer"
]
;
then
if
[
${
model_name
}
=
"ocr_det"
]
;
then
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_det_infer.tar
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/dygraph_v2.0/test/ch_det_data_50.tar
...
...
test_tipc/test_train_inference_python.sh
浏览文件 @
499593c4
...
...
@@ -2,7 +2,7 @@
source
tests/common_func.sh
FILENAME
=
$1
# MODE be one of ['lite_train_
infer' 'whole_infer' 'whole_train_infer', 'infer', 'klquant
_infer']
# MODE be one of ['lite_train_
lite_infer' 'lite_train_whole_infer' 'whole_train_whole_infer', 'whole_infer', 'klquant_whole
_infer']
MODE
=
$2
dataline
=
$(
awk
'NR==1, NR==51{print}'
$FILENAME
)
...
...
@@ -88,7 +88,7 @@ infer_key1=$(func_parser_key "${lines[50]}")
infer_value1
=
$(
func_parser_value
"
${
lines
[50]
}
"
)
# parser klquant_infer
if
[
${
MODE
}
=
"klquant_infer"
]
;
then
if
[
${
MODE
}
=
"klquant_
whole_
infer"
]
;
then
dataline
=
$(
awk
'NR==82, NR==98{print}'
$FILENAME
)
lines
=(
${
dataline
}
)
# parser inference model
...
...
@@ -202,7 +202,7 @@ function func_inference(){
done
}
if
[
${
MODE
}
=
"
infer"
]
||
[
${
MODE
}
=
"klquant
_infer"
]
;
then
if
[
${
MODE
}
=
"
whole_infer"
]
||
[
${
MODE
}
=
"klquant_whole
_infer"
]
;
then
GPUID
=
$3
if
[
${#
GPUID
}
-le
0
]
;
then
env
=
" "
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录