Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_41840029
PaddleOCR
提交
22b57e6e
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看板
提交
22b57e6e
编写于
4月 07, 2022
作者:
L
LDOUBLEV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix rec pact hang
上级
41ba8776
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
36 addition
and
10 deletion
+36
-10
deploy/slim/quantization/export_model.py
deploy/slim/quantization/export_model.py
+1
-0
ppocr/modeling/heads/rec_ctc_head.py
ppocr/modeling/heads/rec_ctc_head.py
+2
-1
test_tipc/configs/ch_PP-OCRv2_rec_PACT/train_infer_python.txt
..._tipc/configs/ch_PP-OCRv2_rec_PACT/train_infer_python.txt
+4
-4
test_tipc/configs/det_mv3_east_v2.0/train_infer_python.txt
test_tipc/configs/det_mv3_east_v2.0/train_infer_python.txt
+2
-2
test_tipc/prepare.sh
test_tipc/prepare.sh
+8
-0
tools/infer/utility.py
tools/infer/utility.py
+19
-3
未找到文件。
deploy/slim/quantization/export_model.py
浏览文件 @
22b57e6e
...
...
@@ -127,6 +127,7 @@ def main():
arch_config
=
config
[
"Architecture"
]
if
arch_config
[
"algorithm"
]
in
[
"Distillation"
,
]:
# distillation model
for
idx
,
name
in
enumerate
(
model
.
model_name_list
):
model
.
model_list
[
idx
].
eval
()
sub_model_save_path
=
os
.
path
.
join
(
save_path
,
name
,
"inference"
)
export_single_model
(
quanter
,
model
.
model_list
[
idx
],
infer_shape
,
sub_model_save_path
,
logger
)
...
...
ppocr/modeling/heads/rec_ctc_head.py
浏览文件 @
22b57e6e
...
...
@@ -80,8 +80,9 @@ class CTCHead(nn.Layer):
result
=
(
x
,
predicts
)
else
:
result
=
predicts
print
(
"self.training: "
,
self
.
training
)
if
not
self
.
training
:
print
(
"self.training, "
,
self
.
training
)
predicts
=
F
.
softmax
(
predicts
,
axis
=
2
)
result
=
predicts
...
...
test_tipc/configs/ch_PP-OCRv2_rec_PACT/train_infer_python.txt
浏览文件 @
22b57e6e
===========================train_params===========================
model_name:
PPOCRv2_ocr_rec_pact
model_name:
ch_PPOCRv2_rec_PACT
python:python3.7
gpu_list:
0|0,1
gpu_list:
6
Global.use_gpu:True|True
Global.auto_cast:fp32
Global.epoch_num:lite_train_lite_infer=
3
|whole_train_whole_infer=300
Global.epoch_num:lite_train_lite_infer=
6
|whole_train_whole_infer=300
Global.save_model_dir:./output/
Train.loader.batch_size_per_card:lite_train_lite_infer=16|whole_train_whole_infer=128
Global.pretrained_model:
null
Global.pretrained_model:
pretrain_models/ch_PP-OCRv2_rec_train/best_accuracy
train_model_name:latest
train_infer_img_dir:./inference/rec_inference
null:null
...
...
test_tipc/configs/det_mv3_east_v2.0/train_infer_python.txt
浏览文件 @
22b57e6e
===========================train_params===========================
model_name:det_mv3_east_v2.0
python:python3.7
gpu_list:0
gpu_list:0
|0,1
Global.use_gpu:True|True
Global.auto_cast:fp32
Global.epoch_num:lite_train_lite_infer=1|whole_train_whole_infer=500
Global.save_model_dir:./output/
Train.loader.batch_size_per_card:lite_train_lite_infer=2|whole_train_whole_infer=4
Global.pretrained_model:
null
Global.pretrained_model:
./pretrain_models/det_mv3_east_v2.0_train/best_accuracy
train_model_name:latest
train_infer_img_dir:./train_data/icdar2015/text_localization/ch4_test_images/
null:null
...
...
test_tipc/prepare.sh
浏览文件 @
22b57e6e
...
...
@@ -64,6 +64,10 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_server_v2.0_det_train.tar
--no-check-certificate
cd
./pretrain_models/
&&
tar
xf ch_ppocr_server_v2.0_det_train.tar
&&
cd
../
fi
if
[
${
model_name
}
==
"ch_PPOCRv2_rec"
]
||
[
${
model_name
}
==
"ch_PPOCRv2_rec_PACT"
]
;
then
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/PP-OCRv2/chinese/ch_PP-OCRv2_rec_train.tar
--no-check-certificate
cd
./pretrain_models/
&&
tar
xf ch_PP-OCRv2_rec_train.tar
&&
cd
../
fi
if
[
${
model_name
}
==
"det_r18_db_v2_0"
]
;
then
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/pretrained/ResNet18_vd_pretrained.pdparams
--no-check-certificate
fi
...
...
@@ -91,6 +95,10 @@ if [ ${MODE} = "lite_train_lite_infer" ];then
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_rec_train.tar
--no-check-certificate
cd
./pretrain_models/
&&
tar
xf ch_ppocr_mobile_v2.0_rec_train.tar
&&
cd
../
fi
if
[
${
model_name
}
==
"det_mv3_east_v2.0"
]
;
then
wget
-nc
-P
./pretrain_models/ https://paddleocr.bj.bcebos.com/dygraph_v2.0/en/det_mv3_east_v2.0_train.tar
--no-check-certificate
cd
./pretrain_models/
&&
tar
xf det_mv3_east_v2.0_train.tar
&&
cd
../
fi
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
--no-check-certificate
...
...
tools/infer/utility.py
浏览文件 @
22b57e6e
...
...
@@ -312,12 +312,28 @@ def create_predictor(args, mode, logger):
input_names
=
predictor
.
get_input_names
()
for
name
in
input_names
:
input_tensor
=
predictor
.
get_input_handle
(
name
)
output_names
=
predictor
.
get_output_names
()
output_tensors
=
[]
output_tensors
=
get_output_tensors
(
args
,
mode
,
predictor
)
#output_names = predictor.get_output_names()
#output_tensors = []
#print("output names", output_names)
#for output_name in output_names:
# output_tensor = predictor.get_output_handle(output_name)
# output_tensors.append(output_tensor)
return
predictor
,
input_tensor
,
output_tensors
,
config
def
get_output_tensors
(
args
,
mode
,
predictor
):
output_names
=
predictor
.
get_output_names
()
output_tensors
=
[]
if
mode
==
"rec"
and
args
.
rec_algorithm
==
"CRNN"
:
output_name
=
'softmax_0.tmp_0'
if
output_name
in
output_names
:
return
[
predictor
.
get_output_handle
(
output_name
)]
else
:
for
output_name
in
output_names
:
output_tensor
=
predictor
.
get_output_handle
(
output_name
)
output_tensors
.
append
(
output_tensor
)
return
predictor
,
input_tensor
,
output_tensors
,
config
return
output_tensors
def
get_infer_gpuid
():
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录