Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
2942cfe6
P
PaddleSeg
项目概览
PaddlePaddle
/
PaddleSeg
通知
285
Star
8
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2942cfe6
编写于
5月 12, 2020
作者:
C
chenguowei01
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update visualdl
上级
d94b69c0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
10 addition
and
24 deletion
+10
-24
contrib/HumanSeg/models/humanseg.py
contrib/HumanSeg/models/humanseg.py
+9
-17
contrib/HumanSeg/requirements.txt
contrib/HumanSeg/requirements.txt
+1
-7
未找到文件。
contrib/HumanSeg/models/humanseg.py
浏览文件 @
2942cfe6
...
@@ -493,10 +493,7 @@ class SegModel(object):
...
@@ -493,10 +493,7 @@ class SegModel(object):
if
use_vdl
:
if
use_vdl
:
from
visualdl
import
LogWriter
from
visualdl
import
LogWriter
vdl_logdir
=
osp
.
join
(
save_dir
,
'vdl_log'
)
vdl_logdir
=
osp
.
join
(
save_dir
,
'vdl_log'
)
log_writer
=
LogWriter
(
vdl_logdir
,
sync_cycle
=
20
)
log_writer
=
LogWriter
(
vdl_logdir
)
train_step_component
=
OrderedDict
()
eval_component
=
OrderedDict
()
best_miou
=
-
1.0
best_miou
=
-
1.0
best_model_epoch
=
1
best_model_epoch
=
1
for
i
in
range
(
self
.
begin_epoch
,
num_epochs
):
for
i
in
range
(
self
.
begin_epoch
,
num_epochs
):
...
@@ -527,13 +524,10 @@ class SegModel(object):
...
@@ -527,13 +524,10 @@ class SegModel(object):
if
use_vdl
:
if
use_vdl
:
for
k
,
v
in
step_metrics
.
items
():
for
k
,
v
in
step_metrics
.
items
():
if
k
not
in
train_step_component
.
keys
():
log_writer
.
add_scalar
(
with
log_writer
.
mode
(
'Each_step_while_Training'
step
=
num_steps
,
)
as
step_logger
:
tag
=
'train/{}'
.
format
(
k
),
train_step_component
[
value
=
v
)
k
]
=
step_logger
.
scalar
(
'Training: {}'
.
format
(
k
))
train_step_component
[
k
].
add_record
(
num_steps
,
v
)
# 计算剩余时间
# 计算剩余时间
avg_step_time
=
np
.
mean
(
time_stat
)
avg_step_time
=
np
.
mean
(
time_stat
)
...
@@ -587,12 +581,10 @@ class SegModel(object):
...
@@ -587,12 +581,10 @@ class SegModel(object):
if
isinstance
(
v
,
np
.
ndarray
):
if
isinstance
(
v
,
np
.
ndarray
):
if
v
.
size
>
1
:
if
v
.
size
>
1
:
continue
continue
if
k
not
in
eval_component
:
log_writer
.
add_scalar
(
with
log_writer
.
mode
(
'Each_Epoch_on_Eval_Data'
step
=
num_steps
,
)
as
eval_logger
:
tag
=
'evaluate/{}'
.
format
(
k
),
eval_component
[
k
]
=
eval_logger
.
scalar
(
value
=
v
)
'Evaluation: {}'
.
format
(
k
))
eval_component
[
k
].
add_record
(
i
+
1
,
v
)
self
.
save_model
(
save_dir
=
current_save_dir
)
self
.
save_model
(
save_dir
=
current_save_dir
)
time_eval_one_epoch
=
time
.
time
()
-
eval_epoch_start_time
time_eval_one_epoch
=
time
.
time
()
-
eval_epoch_start_time
if
eval_dataset
is
not
None
:
if
eval_dataset
is
not
None
:
...
...
contrib/HumanSeg/requirements.txt
浏览文件 @
2942cfe6
pre-commit
yapf == 0.26.0
flake8
pyyaml >= 5.1
pyyaml >= 5.1
visualdl
>= 1.3.0
visualdl
== 2.0.0-alpha.1
Pillow
Pillow
numpy
six
opencv-python
tqdm
tqdm
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录