Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
5340d3d8
P
PaddleOCR
项目概览
weixin_41840029
/
PaddleOCR
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleOCR
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleOCR
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
5340d3d8
编写于
9月 27, 2022
作者:
A
andyj
提交者:
GitHub
9月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #7733 from WenmuZhou/tipc_2
[tipc] add slanet paddle2onnx
上级
321b0a77
83dfaa4b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
88 addition
and
2 deletion
+88
-2
test_tipc/configs/slanet/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt
..._linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt
+17
-0
test_tipc/configs/slanet/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
...ain_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
+53
-0
test_tipc/prepare.sh
test_tipc/prepare.sh
+3
-0
test_tipc/test_paddle2onnx.sh
test_tipc/test_paddle2onnx.sh
+15
-2
未找到文件。
test_tipc/configs/slanet/model_linux_gpu_normal_normal_paddle2onnx_python_linux_cpu.txt
0 → 100644
浏览文件 @
5340d3d8
===========================paddle2onnx_params===========================
model_name:slanet
python:python3.7
2onnx: paddle2onnx
--det_model_dir:./inference/ch_ppstructure_mobile_v2.0_SLANet_infer/
--model_filename:inference.pdmodel
--params_filename:inference.pdiparams
--det_save_file:./inference/ch_ppstructure_mobile_v2.0_SLANet_infer/model.onnx
--rec_model_dir:
--rec_save_file:
--opset_version:10
--enable_onnx_checker:True
inference:ppstructure/table/predict_structure.py --table_char_dict_path=./ppocr/utils/dict/table_structure_dict_ch.txt
--use_gpu:True|False
--det_model_dir:
--rec_model_dir:
--image_dir:./ppstructure/docs/table/table.jpg
\ No newline at end of file
test_tipc/configs/slanet/train_linux_gpu_fleet_normal_infer_python_linux_gpu_cpu.txt
0 → 100644
浏览文件 @
5340d3d8
===========================train_params===========================
model_name:slanet
python:python3.7
gpu_list:192.168.0.1,192.168.0.2;0,1
Global.use_gpu:True
Global.auto_cast:fp32
Global.epoch_num:lite_train_lite_infer=3|whole_train_whole_infer=50
Global.save_model_dir:./output/
Train.loader.batch_size_per_card:lite_train_lite_infer=16|whole_train_whole_infer=128
Global.pretrained_model:./pretrain_models/en_ppstructure_mobile_v2.0_SLANet_train/best_accuracy
train_model_name:latest
train_infer_img_dir:./ppstructure/docs/table/table.jpg
null:null
##
trainer:norm_train
norm_train:tools/train.py -c test_tipc/configs/slanet/SLANet.yml
pact_train:null
fpgm_train:null
distill_train:null
null:null
null:null
##
===========================eval_params===========================
eval:null
null:null
##
===========================infer_params===========================
Global.save_inference_dir:./output/
Global.checkpoints:
norm_export:tools/export_model.py -c test_tipc/configs/slanet/SLANet.yml -o
quant_export:
fpgm_export:
distill_export:null
export1:null
export2:null
##
infer_model:./inference/en_ppstructure_mobile_v2.0_SLANet_train
infer_export:null
infer_quant:False
inference:ppstructure/table/predict_table.py --det_model_dir=./inference/en_ppocr_mobile_v2.0_table_det_infer --rec_model_dir=./inference/en_ppocr_mobile_v2.0_table_rec_infer --rec_char_dict_path=./ppocr/utils/dict/table_dict.txt --table_char_dict_path=./ppocr/utils/dict/table_structure_dict.txt --image_dir=./ppstructure/docs/table/table.jpg --det_limit_side_len=736 --det_limit_type=min --output ./output/table
--use_gpu:True|False
--enable_mkldnn:False
--cpu_threads:6
--rec_batch_num:1
--use_tensorrt:False
--precision:fp32
--table_model_dir:
--image_dir:./ppstructure/docs/table/table.jpg
null:null
--benchmark:False
null:null
===========================infer_benchmark_params==========================
random_infer_input:[{float32,[3,488,488]}]
test_tipc/prepare.sh
浏览文件 @
5340d3d8
...
@@ -791,6 +791,9 @@ if [ ${MODE} = "paddle2onnx_infer" ];then
...
@@ -791,6 +791,9 @@ if [ ${MODE} = "paddle2onnx_infer" ];then
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar
--no-check-certificate
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_infer.tar
--no-check-certificate
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar
--no-check-certificate
wget
-nc
-P
./inference https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_rec_infer.tar
--no-check-certificate
cd
./inference
&&
tar
xf ch_PP-OCRv3_det_infer.tar
&&
tar
xf ch_PP-OCRv3_rec_infer.tar
&&
cd
../
cd
./inference
&&
tar
xf ch_PP-OCRv3_det_infer.tar
&&
tar
xf ch_PP-OCRv3_rec_infer.tar
&&
cd
../
elif
[[
${
model_name
}
=
~
"slanet"
]]
;
then
wget
-nc
-P
./inference/ https://paddleocr.bj.bcebos.com/ppstructure/models/slanet/ch_ppstructure_mobile_v2.0_SLANet_infer.tar
--no-check-certificate
cd
./inference/
&&
tar
xf ch_ppstructure_mobile_v2.0_SLANet_infer.tar
&&
cd
../
fi
fi
# wget data
# wget data
...
...
test_tipc/test_paddle2onnx.sh
浏览文件 @
5340d3d8
...
@@ -105,6 +105,19 @@ function func_paddle2onnx(){
...
@@ -105,6 +105,19 @@ function func_paddle2onnx(){
eval
$trans_model_cmd
eval
$trans_model_cmd
last_status
=
${
PIPESTATUS
[0]
}
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
trans_model_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
"
${
trans_rec_log
}
"
status_check
$last_status
"
${
trans_model_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
"
${
trans_rec_log
}
"
elif
[
${
model_name
}
=
"slanet"
]
;
then
# trans det
set_dirname
=
$(
func_set_params
"--model_dir"
"
${
det_infer_model_dir_value
}
"
)
set_model_filename
=
$(
func_set_params
"
${
model_filename_key
}
"
"
${
model_filename_value
}
"
)
set_params_filename
=
$(
func_set_params
"
${
params_filename_key
}
"
"
${
params_filename_value
}
"
)
set_save_model
=
$(
func_set_params
"--save_file"
"
${
det_save_file_value
}
"
)
set_opset_version
=
$(
func_set_params
"
${
opset_version_key
}
"
"
${
opset_version_value
}
"
)
set_enable_onnx_checker
=
$(
func_set_params
"
${
enable_onnx_checker_key
}
"
"
${
enable_onnx_checker_value
}
"
)
trans_det_log
=
"
${
LOG_PATH
}
/trans_model_det.log"
trans_model_cmd
=
"
${
padlle2onnx_cmd
}
${
set_dirname
}
${
set_model_filename
}
${
set_params_filename
}
${
set_save_model
}
${
set_opset_version
}
${
set_enable_onnx_checker
}
--enable_dev_version=True >
${
trans_det_log
}
2>&1 "
eval
$trans_model_cmd
last_status
=
${
PIPESTATUS
[0]
}
status_check
$last_status
"
${
trans_model_cmd
}
"
"
${
status_log
}
"
"
${
model_name
}
"
"
${
trans_det_log
}
"
fi
fi
# python inference
# python inference
...
@@ -117,7 +130,7 @@ function func_paddle2onnx(){
...
@@ -117,7 +130,7 @@ function func_paddle2onnx(){
set_det_model_dir
=
$(
func_set_params
"
${
det_model_key
}
"
"
${
det_save_file_value
}
"
)
set_det_model_dir
=
$(
func_set_params
"
${
det_model_key
}
"
"
${
det_save_file_value
}
"
)
set_rec_model_dir
=
$(
func_set_params
"
${
rec_model_key
}
"
"
${
rec_save_file_value
}
"
)
set_rec_model_dir
=
$(
func_set_params
"
${
rec_model_key
}
"
"
${
rec_save_file_value
}
"
)
infer_model_cmd
=
"
${
python
}
${
inference_py
}
${
set_gpu
}
${
set_img_dir
}
${
set_det_model_dir
}
${
set_rec_model_dir
}
--use_onnx=True >
${
_save_log_path
}
2>&1 "
infer_model_cmd
=
"
${
python
}
${
inference_py
}
${
set_gpu
}
${
set_img_dir
}
${
set_det_model_dir
}
${
set_rec_model_dir
}
--use_onnx=True >
${
_save_log_path
}
2>&1 "
elif
[[
${
model_name
}
=
~
"det"
]]
;
then
elif
[[
${
model_name
}
=
~
"det"
]]
||
[
${
model_name
}
=
"slanet"
]
;
then
set_det_model_dir
=
$(
func_set_params
"
${
det_model_key
}
"
"
${
det_save_file_value
}
"
)
set_det_model_dir
=
$(
func_set_params
"
${
det_model_key
}
"
"
${
det_save_file_value
}
"
)
infer_model_cmd
=
"
${
python
}
${
inference_py
}
${
set_gpu
}
${
set_img_dir
}
${
set_det_model_dir
}
--use_onnx=True >
${
_save_log_path
}
2>&1 "
infer_model_cmd
=
"
${
python
}
${
inference_py
}
${
set_gpu
}
${
set_img_dir
}
${
set_det_model_dir
}
--use_onnx=True >
${
_save_log_path
}
2>&1 "
elif
[[
${
model_name
}
=
~
"rec"
]]
;
then
elif
[[
${
model_name
}
=
~
"rec"
]]
;
then
...
@@ -136,7 +149,7 @@ function func_paddle2onnx(){
...
@@ -136,7 +149,7 @@ function func_paddle2onnx(){
set_det_model_dir
=
$(
func_set_params
"
${
det_model_key
}
"
"
${
det_save_file_value
}
"
)
set_det_model_dir
=
$(
func_set_params
"
${
det_model_key
}
"
"
${
det_save_file_value
}
"
)
set_rec_model_dir
=
$(
func_set_params
"
${
rec_model_key
}
"
"
${
rec_save_file_value
}
"
)
set_rec_model_dir
=
$(
func_set_params
"
${
rec_model_key
}
"
"
${
rec_save_file_value
}
"
)
infer_model_cmd
=
"
${
python
}
${
inference_py
}
${
set_gpu
}
${
set_img_dir
}
${
set_det_model_dir
}
${
set_rec_model_dir
}
--use_onnx=True >
${
_save_log_path
}
2>&1 "
infer_model_cmd
=
"
${
python
}
${
inference_py
}
${
set_gpu
}
${
set_img_dir
}
${
set_det_model_dir
}
${
set_rec_model_dir
}
--use_onnx=True >
${
_save_log_path
}
2>&1 "
elif
[[
${
model_name
}
=
~
"det"
]]
;
then
elif
[[
${
model_name
}
=
~
"det"
]]
||
[
${
model_name
}
=
"slanet"
]
;
then
set_det_model_dir
=
$(
func_set_params
"
${
det_model_key
}
"
"
${
det_save_file_value
}
"
)
set_det_model_dir
=
$(
func_set_params
"
${
det_model_key
}
"
"
${
det_save_file_value
}
"
)
infer_model_cmd
=
"
${
python
}
${
inference_py
}
${
set_gpu
}
${
set_img_dir
}
${
set_det_model_dir
}
--use_onnx=True >
${
_save_log_path
}
2>&1 "
infer_model_cmd
=
"
${
python
}
${
inference_py
}
${
set_gpu
}
${
set_img_dir
}
${
set_det_model_dir
}
--use_onnx=True >
${
_save_log_path
}
2>&1 "
elif
[[
${
model_name
}
=
~
"rec"
]]
;
then
elif
[[
${
model_name
}
=
~
"rec"
]]
;
then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录