Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
1b959e3e
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看板
提交
1b959e3e
编写于
4月 25, 2021
作者:
littletomatodonkey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add save rec res
上级
05975f84
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
50 addition
and
28 deletion
+50
-28
configs/rec/ch_ppocr_v2.0/rec_chinese_common_train_v2.0.yml
configs/rec/ch_ppocr_v2.0/rec_chinese_common_train_v2.0.yml
+1
-0
configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml
configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml
+1
-0
configs/rec/rec_icdar15_train.yml
configs/rec/rec_icdar15_train.yml
+1
-0
configs/rec/rec_mv3_none_bilstm_ctc.yml
configs/rec/rec_mv3_none_bilstm_ctc.yml
+1
-0
configs/rec/rec_mv3_none_none_ctc.yml
configs/rec/rec_mv3_none_none_ctc.yml
+1
-0
configs/rec/rec_mv3_tps_bilstm_att.yml
configs/rec/rec_mv3_tps_bilstm_att.yml
+1
-0
configs/rec/rec_mv3_tps_bilstm_ctc.yml
configs/rec/rec_mv3_tps_bilstm_ctc.yml
+1
-0
configs/rec/rec_r34_vd_none_bilstm_ctc.yml
configs/rec/rec_r34_vd_none_bilstm_ctc.yml
+1
-0
configs/rec/rec_r34_vd_none_none_ctc.yml
configs/rec/rec_r34_vd_none_none_ctc.yml
+1
-0
configs/rec/rec_r34_vd_tps_bilstm_att.yml
configs/rec/rec_r34_vd_tps_bilstm_att.yml
+1
-0
configs/rec/rec_r34_vd_tps_bilstm_ctc.yml
configs/rec/rec_r34_vd_tps_bilstm_ctc.yml
+1
-0
configs/rec/rec_r50_fpn_srn.yml
configs/rec/rec_r50_fpn_srn.yml
+1
-0
tools/infer_rec.py
tools/infer_rec.py
+38
-28
未找到文件。
configs/rec/ch_ppocr_v2.0/rec_chinese_common_train_v2.0.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
True
use_space_char
:
True
save_res_path
:
./output/rec/predicts_chinese_common_v2.0.txt
Optimizer
:
Optimizer
:
...
...
configs/rec/ch_ppocr_v2.0/rec_chinese_lite_train_v2.0.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
True
use_space_char
:
True
# save_res_path: ./output/rec/predicts_chinese_lite_v2.0.txt
Optimizer
:
Optimizer
:
...
...
configs/rec/rec_icdar15_train.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
save_res_path
:
./output/rec/predicts_ic15.txt
Optimizer
:
Optimizer
:
name
:
Adam
name
:
Adam
...
...
configs/rec/rec_mv3_none_bilstm_ctc.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
save_res_path
:
./output/rec/predicts_mv3_none_bilstm_ctc.txt
Optimizer
:
Optimizer
:
name
:
Adam
name
:
Adam
...
...
configs/rec/rec_mv3_none_none_ctc.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
save_res_path
:
./output/rec/predicts_mv3_none_none_ctc.txt
Optimizer
:
Optimizer
:
name
:
Adam
name
:
Adam
...
...
configs/rec/rec_mv3_tps_bilstm_att.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
save_res_path
:
./output/rec/predicts_mv3_tps_bilstm_att.txt
Optimizer
:
Optimizer
:
...
...
configs/rec/rec_mv3_tps_bilstm_ctc.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
save_res_path
:
./output/rec/predicts_mv3_tps_bilstm_ctc.txt
Optimizer
:
Optimizer
:
name
:
Adam
name
:
Adam
...
...
configs/rec/rec_r34_vd_none_bilstm_ctc.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
save_res_path
:
./output/rec/predicts_r34_vd_none_bilstm_ctc.txt
Optimizer
:
Optimizer
:
name
:
Adam
name
:
Adam
...
...
configs/rec/rec_r34_vd_none_none_ctc.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
save_res_path
:
./output/rec/predicts_r34_vd_none_none_ctc.txt
Optimizer
:
Optimizer
:
name
:
Adam
name
:
Adam
...
...
configs/rec/rec_r34_vd_tps_bilstm_att.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
save_res_path
:
./output/rec/predicts_b3_rare_r34_none_gru.txt
Optimizer
:
Optimizer
:
...
...
configs/rec/rec_r34_vd_tps_bilstm_ctc.yml
浏览文件 @
1b959e3e
...
@@ -19,6 +19,7 @@ Global:
...
@@ -19,6 +19,7 @@ Global:
max_text_length
:
25
max_text_length
:
25
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
save_res_path
:
./output/rec/predicts_r34_vd_tps_bilstm_ctc.txt
Optimizer
:
Optimizer
:
name
:
Adam
name
:
Adam
...
...
configs/rec/rec_r50_fpn_srn.yml
浏览文件 @
1b959e3e
...
@@ -20,6 +20,7 @@ Global:
...
@@ -20,6 +20,7 @@ Global:
num_heads
:
8
num_heads
:
8
infer_mode
:
False
infer_mode
:
False
use_space_char
:
False
use_space_char
:
False
save_res_path
:
./output/rec/predicts_srn.txt
Optimizer
:
Optimizer
:
...
...
tools/infer_rec.py
浏览文件 @
1b959e3e
...
@@ -73,7 +73,14 @@ def main():
...
@@ -73,7 +73,14 @@ def main():
global_config
[
'infer_mode'
]
=
True
global_config
[
'infer_mode'
]
=
True
ops
=
create_operators
(
transforms
,
global_config
)
ops
=
create_operators
(
transforms
,
global_config
)
save_res_path
=
config
[
'Global'
].
get
(
'save_res_path'
,
"./output/rec/predicts_rec.txt"
)
if
not
os
.
path
.
exists
(
os
.
path
.
dirname
(
save_res_path
)):
os
.
makedirs
(
os
.
path
.
dirname
(
save_res_path
))
model
.
eval
()
model
.
eval
()
with
open
(
save_res_path
,
"w"
)
as
fout
:
for
file
in
get_image_file_list
(
config
[
'Global'
][
'infer_img'
]):
for
file
in
get_image_file_list
(
config
[
'Global'
][
'infer_img'
]):
logger
.
info
(
"infer_img: {}"
.
format
(
file
))
logger
.
info
(
"infer_img: {}"
.
format
(
file
))
with
open
(
file
,
'rb'
)
as
f
:
with
open
(
file
,
'rb'
)
as
f
:
...
@@ -102,6 +109,9 @@ def main():
...
@@ -102,6 +109,9 @@ def main():
post_result
=
post_process_class
(
preds
)
post_result
=
post_process_class
(
preds
)
for
rec_reuslt
in
post_result
:
for
rec_reuslt
in
post_result
:
logger
.
info
(
'
\t
result: {}'
.
format
(
rec_reuslt
))
logger
.
info
(
'
\t
result: {}'
.
format
(
rec_reuslt
))
if
len
(
rec_reuslt
)
>=
2
:
fout
.
write
(
file
+
"
\t
"
+
rec_reuslt
[
0
]
+
"
\t
"
+
str
(
rec_reuslt
[
1
])
+
"
\n
"
)
logger
.
info
(
"success!"
)
logger
.
info
(
"success!"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录