Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleOCR
提交
fcfdd0a3
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看板
提交
fcfdd0a3
编写于
5月 26, 2020
作者:
L
LDOUBLEV
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set mode of DB head as 'export' when export model
上级
93bd46e9
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
8 addition
and
5 deletion
+8
-5
ppocr/modeling/architectures/det_model.py
ppocr/modeling/architectures/det_model.py
+4
-1
ppocr/modeling/heads/det_db_head.py
ppocr/modeling/heads/det_db_head.py
+1
-1
tools/program.py
tools/program.py
+3
-3
未找到文件。
ppocr/modeling/architectures/det_model.py
浏览文件 @
fcfdd0a3
...
@@ -109,6 +109,9 @@ class DetModel(object):
...
@@ -109,6 +109,9 @@ class DetModel(object):
"""
"""
image
,
labels
,
loader
=
self
.
create_feed
(
mode
)
image
,
labels
,
loader
=
self
.
create_feed
(
mode
)
conv_feas
=
self
.
backbone
(
image
)
conv_feas
=
self
.
backbone
(
image
)
if
self
.
algorithm
==
"DB"
:
predicts
=
self
.
head
(
conv_feas
,
mode
)
else
:
predicts
=
self
.
head
(
conv_feas
)
predicts
=
self
.
head
(
conv_feas
)
if
mode
==
"train"
:
if
mode
==
"train"
:
losses
=
self
.
loss
(
predicts
,
labels
)
losses
=
self
.
loss
(
predicts
,
labels
)
...
...
ppocr/modeling/heads/det_db_head.py
浏览文件 @
fcfdd0a3
...
@@ -196,7 +196,7 @@ class DBHead(object):
...
@@ -196,7 +196,7 @@ class DBHead(object):
fuse
=
fluid
.
layers
.
concat
(
input
=
[
p5
,
p4
,
p3
,
p2
],
axis
=
1
)
fuse
=
fluid
.
layers
.
concat
(
input
=
[
p5
,
p4
,
p3
,
p2
],
axis
=
1
)
shrink_maps
=
self
.
binarize
(
fuse
)
shrink_maps
=
self
.
binarize
(
fuse
)
if
mode
!=
"train"
:
if
mode
!=
"train"
:
return
{
"maps"
,
shrink_maps
}
return
{
"maps"
:
shrink_maps
}
threshold_maps
=
self
.
thresh
(
fuse
)
threshold_maps
=
self
.
thresh
(
fuse
)
binary_maps
=
self
.
step_function
(
shrink_maps
,
threshold_maps
)
binary_maps
=
self
.
step_function
(
shrink_maps
,
threshold_maps
)
y
=
fluid
.
layers
.
concat
(
y
=
fluid
.
layers
.
concat
(
...
...
tools/program.py
浏览文件 @
fcfdd0a3
...
@@ -191,7 +191,7 @@ def build_export(config, main_prog, startup_prog):
...
@@ -191,7 +191,7 @@ def build_export(config, main_prog, startup_prog):
func_infor
=
config
[
'Architecture'
][
'function'
]
func_infor
=
config
[
'Architecture'
][
'function'
]
model
=
create_module
(
func_infor
)(
params
=
config
)
model
=
create_module
(
func_infor
)(
params
=
config
)
image
,
outputs
=
model
(
mode
=
'export'
)
image
,
outputs
=
model
(
mode
=
'export'
)
fetches_var_name
=
sorted
([
name
for
name
in
outputs
])
fetches_var_name
=
sorted
([
name
for
name
in
outputs
.
keys
()
])
fetches_var
=
[
outputs
[
name
]
for
name
in
fetches_var_name
]
fetches_var
=
[
outputs
[
name
]
for
name
in
fetches_var_name
]
feeded_var_names
=
[
image
.
name
]
feeded_var_names
=
[
image
.
name
]
target_vars
=
fetches_var
target_vars
=
fetches_var
...
@@ -271,7 +271,7 @@ def train_eval_det_run(config, exe, train_info_dict, eval_info_dict):
...
@@ -271,7 +271,7 @@ def train_eval_det_run(config, exe, train_info_dict, eval_info_dict):
train_loader
.
reset
()
train_loader
.
reset
()
if
epoch
==
0
and
save_epoch_step
==
1
:
if
epoch
==
0
and
save_epoch_step
==
1
:
save_path
=
save_model_dir
+
"/iter_epoch_0"
save_path
=
save_model_dir
+
"/iter_epoch_0"
save_model
(
train_info_dict
[
'train_program'
],
save_path
)
save_model
(
train_info_dict
[
'train_program'
],
save_path
)
if
epoch
>
0
and
epoch
%
save_epoch_step
==
0
:
if
epoch
>
0
and
epoch
%
save_epoch_step
==
0
:
save_path
=
save_model_dir
+
"/iter_epoch_%d"
%
(
epoch
)
save_path
=
save_model_dir
+
"/iter_epoch_%d"
%
(
epoch
)
save_model
(
train_info_dict
[
'train_program'
],
save_path
)
save_model
(
train_info_dict
[
'train_program'
],
save_path
)
...
@@ -350,7 +350,7 @@ def train_eval_rec_run(config, exe, train_info_dict, eval_info_dict):
...
@@ -350,7 +350,7 @@ def train_eval_rec_run(config, exe, train_info_dict, eval_info_dict):
train_loader
.
reset
()
train_loader
.
reset
()
if
epoch
==
0
and
save_epoch_step
==
1
:
if
epoch
==
0
and
save_epoch_step
==
1
:
save_path
=
save_model_dir
+
"/iter_epoch_0"
save_path
=
save_model_dir
+
"/iter_epoch_0"
save_model
(
train_info_dict
[
'train_program'
],
save_path
)
save_model
(
train_info_dict
[
'train_program'
],
save_path
)
if
epoch
>
0
and
epoch
%
save_epoch_step
==
0
:
if
epoch
>
0
and
epoch
%
save_epoch_step
==
0
:
save_path
=
save_model_dir
+
"/iter_epoch_%d"
%
(
epoch
)
save_path
=
save_model_dir
+
"/iter_epoch_%d"
%
(
epoch
)
save_model
(
train_info_dict
[
'train_program'
],
save_path
)
save_model
(
train_info_dict
[
'train_program'
],
save_path
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录