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
7be68dbd
Commit
7be68dbd
authored
Sep 08, 2021
by
MissPenguin
Browse files
fix readme
parent
96e1ce3d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
22 deletions
+32
-22
tests/readme.md
tests/readme.md
+28
-18
tests/test.sh
tests/test.sh
+4
-4
No files found.
tests/readme.md
View file @
7be68dbd
...
@@ -25,34 +25,44 @@ test.sh和params.txt文件配合使用,完成OCR轻量检测和识别模型从
...
@@ -25,34 +25,44 @@ test.sh和params.txt文件配合使用,完成OCR轻量检测和识别模型从
tests/
tests/
├── ocr_det_params.txt
# 测试OCR检测模型的参数配置文件
├── ocr_det_params.txt
# 测试OCR检测模型的参数配置文件
├── ocr_rec_params.txt
# 测试OCR识别模型的参数配置文件
├── ocr_rec_params.txt
# 测试OCR识别模型的参数配置文件
├── ocr_ppocr_mobile_params.txt
# 测试OCR检测+识别模型串联的参数配置文件
└── prepare.sh
# 完成test.sh运行所需要的数据和模型下载
└── prepare.sh
# 完成test.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
View file @
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
_key
1
=
$(
func_parser_key
"
${
lines
[64]
}
"
)
cpp_
rec_model
_value
=
$(
func_parser_value
"
${
lines
[64]
}
"
)
cpp_
infer
_value
1
=
$(
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
_key
1
}
"
"
${
cpp_
infer
_value
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 "
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
_key
1
}
"
"
${
cpp_
infer
_value
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 "
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]
}
...
...
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