Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleOCR
提交
bfb46261
P
PaddleOCR
项目概览
s920243400
/
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看板
未验证
提交
bfb46261
编写于
7月 14, 2022
作者:
W
whjdark
提交者:
GitHub
7月 14, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'PaddlePaddle:dygraph' into dygraph
上级
c167df2f
4bb366cc
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
20 addition
and
14 deletion
+20
-14
configs/det/det_r50_db++_icdar15.yml
configs/det/det_r50_db++_icdar15.yml
+0
-0
doc/doc_ch/algorithm_det_db.md
doc/doc_ch/algorithm_det_db.md
+1
-1
test_tipc/benchmark_train.sh
test_tipc/benchmark_train.sh
+10
-4
test_tipc/configs/en_table_structure/train_pact_infer_python.txt
...pc/configs/en_table_structure/train_pact_infer_python.txt
+1
-1
test_tipc/prepare.sh
test_tipc/prepare.sh
+1
-1
test_tipc/test_ptq_inference_python.sh
test_tipc/test_ptq_inference_python.sh
+1
-1
test_tipc/test_train_inference_python.sh
test_tipc/test_train_inference_python.sh
+4
-4
tools/infer_det.py
tools/infer_det.py
+2
-2
未找到文件。
configs/det/det_r50_db++_ic15.yml
→
configs/det/det_r50_db++_ic
dar
15.yml
浏览文件 @
bfb46261
文件已移动
doc/doc_ch/algorithm_det_db.md
浏览文件 @
bfb46261
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
| --- | --- | --- | --- | --- | --- | --- |
| --- | --- | --- | --- | --- | --- | --- |
|DB|ResNet50_vd|
[
configs/det/det_r50_vd_db.yml
](
../../configs/det/det_r50_vd_db.yml
)
|86.41%|78.72%|82.38%|
[
训练模型
](
https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_db_v2.0_train.tar
)
|
|DB|ResNet50_vd|
[
configs/det/det_r50_vd_db.yml
](
../../configs/det/det_r50_vd_db.yml
)
|86.41%|78.72%|82.38%|
[
训练模型
](
https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_r50_vd_db_v2.0_train.tar
)
|
|DB|MobileNetV3|
[
configs/det/det_mv3_db.yml
](
../../configs/det/det_mv3_db.yml
)
|77.29%|73.08%|75.12%|
[
训练模型
](
https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar
)
|
|DB|MobileNetV3|
[
configs/det/det_mv3_db.yml
](
../../configs/det/det_mv3_db.yml
)
|77.29%|73.08%|75.12%|
[
训练模型
](
https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_db_v2.0_train.tar
)
|
|DB++|ResNet50|
[
configs/det/det_r50_db++_ic
15.yml
](
../../configs/det/det_r50_db++_ic
15.yml
)
|90.89%|82.66%|86.58%|
[
合成数据预训练模型
](
https://paddleocr.bj.bcebos.com/dygraph_v2.1/en_det/ResNet50_dcn_asf_synthtext_pretrained.pdparams
)
/
[
训练模型
](
https://paddleocr.bj.bcebos.com/dygraph_v2.1/en_det/det_r50_db%2B%2B_icdar15_train.tar
)
|
|DB++|ResNet50|
[
configs/det/det_r50_db++_ic
dar15.yml
](
../../configs/det/det_r50_db++_icdar
15.yml
)
|90.89%|82.66%|86.58%|
[
合成数据预训练模型
](
https://paddleocr.bj.bcebos.com/dygraph_v2.1/en_det/ResNet50_dcn_asf_synthtext_pretrained.pdparams
)
/
[
训练模型
](
https://paddleocr.bj.bcebos.com/dygraph_v2.1/en_det/det_r50_db%2B%2B_icdar15_train.tar
)
|
在TD_TR文本检测公开数据集上,算法复现效果如下:
在TD_TR文本检测公开数据集上,算法复现效果如下:
...
...
test_tipc/benchmark_train.sh
浏览文件 @
bfb46261
...
@@ -139,8 +139,8 @@ else
...
@@ -139,8 +139,8 @@ else
device_num
=
${
params_list
[4]
}
device_num
=
${
params_list
[4]
}
IFS
=
";"
IFS
=
";"
if
[
${
precision
}
=
"
null
"
]
;
then
if
[
${
precision
}
=
"
fp16
"
]
;
then
precision
=
"
fp32
"
precision
=
"
amp
"
fi
fi
fp_items_list
=(
$precision
)
fp_items_list
=(
$precision
)
...
@@ -150,10 +150,16 @@ fi
...
@@ -150,10 +150,16 @@ fi
IFS
=
"|"
IFS
=
"|"
for
batch_size
in
${
batch_size_list
[*]
}
;
do
for
batch_size
in
${
batch_size_list
[*]
}
;
do
for
precision
in
${
fp_items_list
[*]
}
;
do
for
train_
precision
in
${
fp_items_list
[*]
}
;
do
for
device_num
in
${
device_num_list
[*]
}
;
do
for
device_num
in
${
device_num_list
[*]
}
;
do
# sed batchsize and precision
# sed batchsize and precision
func_sed_params
"
$FILENAME
"
"
${
line_precision
}
"
"
$precision
"
if
[
${
train_precision
}
=
"amp"
]
;
then
precision
=
"fp16"
else
precision
=
"fp32"
fi
func_sed_params
"
$FILENAME
"
"
${
line_precision
}
"
"
$train_precision
"
func_sed_params
"
$FILENAME
"
"
${
line_batchsize
}
"
"
$MODE
=
$batch_size
"
func_sed_params
"
$FILENAME
"
"
${
line_batchsize
}
"
"
$MODE
=
$batch_size
"
func_sed_params
"
$FILENAME
"
"
${
line_epoch
}
"
"
$MODE
=
$epoch
"
func_sed_params
"
$FILENAME
"
"
${
line_epoch
}
"
"
$MODE
=
$epoch
"
gpu_id
=
$(
set_gpu_id
$device_num
)
gpu_id
=
$(
set_gpu_id
$device_num
)
...
...
test_tipc/configs/en_table_structure/train_pact_infer_python.txt
浏览文件 @
bfb46261
...
@@ -6,7 +6,7 @@ Global.use_gpu:True|True
...
@@ -6,7 +6,7 @@ Global.use_gpu:True|True
Global.auto_cast:fp32
Global.auto_cast:fp32
Global.epoch_num:lite_train_lite_infer=1|whole_train_whole_infer=50
Global.epoch_num:lite_train_lite_infer=1|whole_train_whole_infer=50
Global.save_model_dir:./output/
Global.save_model_dir:./output/
Train.loader.batch_size_per_card:lite_train_lite_infer=
16|whole_train_whole_infer=128
Train.loader.batch_size_per_card:lite_train_lite_infer=
2|whole_train_whole_infer=2
Global.pretrained_model:./pretrain_models/en_ppocr_mobile_v2.0_table_structure_train/best_accuracy
Global.pretrained_model:./pretrain_models/en_ppocr_mobile_v2.0_table_structure_train/best_accuracy
train_model_name:latest
train_model_name:latest
train_infer_img_dir:./ppstructure/docs/table/table.jpg
train_infer_img_dir:./ppstructure/docs/table/table.jpg
...
...
test_tipc/prepare.sh
浏览文件 @
bfb46261
...
@@ -58,7 +58,7 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
...
@@ -58,7 +58,7 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_distill_train.tar
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv3/chinese/ch_PP-OCRv3_det_distill_train.tar
--no-check-certificate
cd
./pretrain_models/
&&
tar
xf ch_PP-OCRv3_det_distill_train.tar
&&
cd
../
cd
./pretrain_models/
&&
tar
xf ch_PP-OCRv3_det_distill_train.tar
&&
cd
../
fi
fi
if
[
${
model_name
}
==
"en_table_structure"
]
;
then
if
[
${
model_name
}
==
"en_table_structure"
]
||
[
${
model_name
}
==
"en_table_structure_PACT"
]
;
then
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/table/en_ppocr_mobile_v2.0_table_structure_train.tar
--no-check-certificate
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.1/table/en_ppocr_mobile_v2.0_table_structure_train.tar
--no-check-certificate
cd
./pretrain_models/
&&
tar
xf en_ppocr_mobile_v2.0_table_structure_train.tar
&&
cd
../
cd
./pretrain_models/
&&
tar
xf en_ppocr_mobile_v2.0_table_structure_train.tar
&&
cd
../
wget
-nc
-P
./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_det_infer.tar
--no-check-certificate
wget
-nc
-P
./inference/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/table/en_ppocr_mobile_v2.0_table_det_infer.tar
--no-check-certificate
...
...
test_tipc/test_ptq_inference_python.sh
浏览文件 @
bfb46261
...
@@ -139,7 +139,7 @@ if [ ${MODE} = "whole_infer" ]; then
...
@@ -139,7 +139,7 @@ if [ ${MODE} = "whole_infer" ]; then
save_infer_dir
=
"
${
infer_model
}
_klquant"
save_infer_dir
=
"
${
infer_model
}
_klquant"
set_export_weight
=
$(
func_set_params
"
${
export_weight
}
"
"
${
infer_model
}
"
)
set_export_weight
=
$(
func_set_params
"
${
export_weight
}
"
"
${
infer_model
}
"
)
set_save_infer_key
=
$(
func_set_params
"
${
save_infer_key
}
"
"
${
save_infer_dir
}
"
)
set_save_infer_key
=
$(
func_set_params
"
${
save_infer_key
}
"
"
${
save_infer_dir
}
"
)
export_log_path
=
"
${
LOG_PATH
}
_export_
${
Count
}
.log"
export_log_path
=
"
${
LOG_PATH
}
/
${
MODE
}
_export_
${
Count
}
.log"
export_cmd
=
"
${
python
}
${
infer_run_exports
[Count]
}
${
set_export_weight
}
${
set_save_infer_key
}
>
${
export_log_path
}
2>&1 "
export_cmd
=
"
${
python
}
${
infer_run_exports
[Count]
}
${
set_export_weight
}
${
set_save_infer_key
}
>
${
export_log_path
}
2>&1 "
echo
${
infer_run_exports
[Count]
}
echo
${
infer_run_exports
[Count]
}
echo
$export_cmd
echo
$export_cmd
...
...
test_tipc/test_train_inference_python.sh
浏览文件 @
bfb46261
...
@@ -265,7 +265,7 @@ else
...
@@ -265,7 +265,7 @@ else
if
[
${
run_train
}
=
"null"
]
;
then
if
[
${
run_train
}
=
"null"
]
;
then
continue
continue
fi
fi
set_autocast
=
$(
func_set_params
"
${
autocast_key
}
"
"
${
autocast
}
"
)
set_epoch
=
$(
func_set_params
"
${
epoch_key
}
"
"
${
epoch_num
}
"
)
set_epoch
=
$(
func_set_params
"
${
epoch_key
}
"
"
${
epoch_num
}
"
)
set_pretrain
=
$(
func_set_params
"
${
pretrain_model_key
}
"
"
${
pretrain_model_value
}
"
)
set_pretrain
=
$(
func_set_params
"
${
pretrain_model_key
}
"
"
${
pretrain_model_value
}
"
)
set_batchsize
=
$(
func_set_params
"
${
train_batch_key
}
"
"
${
train_batch_value
}
"
)
set_batchsize
=
$(
func_set_params
"
${
train_batch_key
}
"
"
${
train_batch_value
}
"
)
...
@@ -287,11 +287,11 @@ else
...
@@ -287,11 +287,11 @@ else
set_save_model
=
$(
func_set_params
"
${
save_model_key
}
"
"
${
save_log
}
"
)
set_save_model
=
$(
func_set_params
"
${
save_model_key
}
"
"
${
save_log
}
"
)
if
[
${#
gpu
}
-le
2
]
;
then
# train with cpu or single gpu
if
[
${#
gpu
}
-le
2
]
;
then
# train with cpu or single gpu
cmd
=
"
${
python
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_epoch
}
${
set_pretrain
}
${
set_autocast
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
"
cmd
=
"
${
python
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_epoch
}
${
set_pretrain
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
"
elif
[
${#
ips
}
-le
15
]
;
then
# train with multi-gpu
elif
[
${#
ips
}
-le
15
]
;
then
# train with multi-gpu
cmd
=
"
${
python
}
-m paddle.distributed.launch --gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_epoch
}
${
set_pretrain
}
${
set_autocast
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
"
cmd
=
"
${
python
}
-m paddle.distributed.launch --gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_epoch
}
${
set_pretrain
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
"
else
# train with multi-machine
else
# train with multi-machine
cmd
=
"
${
python
}
-m paddle.distributed.launch --ips=
${
ips
}
--gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_pretrain
}
${
set_epoch
}
${
set_autocast
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
"
cmd
=
"
${
python
}
-m paddle.distributed.launch --ips=
${
ips
}
--gpus=
${
gpu
}
${
run_train
}
${
set_use_gpu
}
${
set_save_model
}
${
set_pretrain
}
${
set_epoch
}
${
set_batchsize
}
${
set_train_params1
}
${
set_amp_config
}
"
fi
fi
# run train
# run train
eval
$cmd
eval
$cmd
...
...
tools/infer_det.py
浏览文件 @
bfb46261
...
@@ -106,7 +106,7 @@ def main():
...
@@ -106,7 +106,7 @@ def main():
dt_boxes_list
=
[]
dt_boxes_list
=
[]
for
box
in
boxes
:
for
box
in
boxes
:
tmp_json
=
{
"transcription"
:
""
}
tmp_json
=
{
"transcription"
:
""
}
tmp_json
[
'points'
]
=
list
(
box
)
tmp_json
[
'points'
]
=
np
.
array
(
box
).
tolist
(
)
dt_boxes_list
.
append
(
tmp_json
)
dt_boxes_list
.
append
(
tmp_json
)
det_box_json
[
k
]
=
dt_boxes_list
det_box_json
[
k
]
=
dt_boxes_list
save_det_path
=
os
.
path
.
dirname
(
config
[
'Global'
][
save_det_path
=
os
.
path
.
dirname
(
config
[
'Global'
][
...
@@ -118,7 +118,7 @@ def main():
...
@@ -118,7 +118,7 @@ def main():
# write result
# write result
for
box
in
boxes
:
for
box
in
boxes
:
tmp_json
=
{
"transcription"
:
""
}
tmp_json
=
{
"transcription"
:
""
}
tmp_json
[
'points'
]
=
list
(
box
)
tmp_json
[
'points'
]
=
np
.
array
(
box
).
tolist
(
)
dt_boxes_json
.
append
(
tmp_json
)
dt_boxes_json
.
append
(
tmp_json
)
save_det_path
=
os
.
path
.
dirname
(
config
[
'Global'
][
save_det_path
=
os
.
path
.
dirname
(
config
[
'Global'
][
'save_res_path'
])
+
"/det_results/"
'save_res_path'
])
+
"/det_results/"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录