Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
8393d05b
P
PaddleSeg
项目概览
PaddlePaddle
/
PaddleSeg
通知
287
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看板
提交
8393d05b
编写于
6月 29, 2020
作者:
C
chenguowei01
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
上级
ce7fb0d0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
3 addition
and
38 deletion
+3
-38
pdseg/models/backbone/resnet.py
pdseg/models/backbone/resnet.py
+1
-3
pdseg/models/modeling/deeplab.py
pdseg/models/modeling/deeplab.py
+1
-34
pdseg/utils/config.py
pdseg/utils/config.py
+1
-1
未找到文件。
pdseg/models/backbone/resnet.py
浏览文件 @
8393d05b
...
...
@@ -85,7 +85,7 @@ class ResNet():
depth
=
[
3
,
8
,
36
,
3
]
num_filters
=
[
64
,
128
,
256
,
512
]
if
self
.
stem
==
'icnet'
or
self
.
stem
==
'pspnet'
or
self
.
stem
==
'deeplab'
:
if
self
.
stem
==
'icnet'
or
self
.
stem
==
'pspnet'
:
conv
=
self
.
conv_bn_layer
(
input
=
input
,
num_filters
=
int
(
64
*
self
.
scale
),
...
...
@@ -256,8 +256,6 @@ class ResNet():
return
input
def
bottleneck_block
(
self
,
input
,
num_filters
,
stride
,
name
,
dilation
=
1
):
if
self
.
stem
==
'deeplab'
:
strides
=
[
1
,
stride
]
if
self
.
stem
==
'pspnet'
and
self
.
layers
==
101
:
strides
=
[
1
,
stride
]
else
:
...
...
pdseg/models/modeling/deeplab.py
浏览文件 @
8393d05b
...
...
@@ -229,37 +229,6 @@ def xception(input):
return
data
,
decode_shortcut
def
resnet
(
input
):
# backbone: resnet, 可选resnet_50, resnet_101
# end_points: resnet终止层数
# dilation_dict: resnet block数及对应的膨胀卷积尺度
backbone
=
cfg
.
MODEL
.
DEEPLAB
.
BACKBONE
if
'50'
in
backbone
:
layers
=
50
elif
'101'
in
backbone
:
layers
=
101
else
:
raise
Exception
(
"resnet backbone only support layers 50 or 101"
)
output_stride
=
cfg
.
MODEL
.
DEEPLAB
.
OUTPUT_STRIDE
end_points
=
layers
-
1
decode_point
=
10
if
output_stride
==
8
:
dilation_dict
=
{
2
:
2
,
3
:
4
}
elif
output_stride
==
16
:
dilation_dict
=
{
3
:
2
}
else
:
raise
Exception
(
"deeplab only support stride 8 or 16"
)
model
=
resnet_backbone
(
layers
,
stem
=
'deeplab'
)
data
,
decode_shortcuts
=
model
.
net
(
input
,
end_points
=
end_points
,
decode_points
=
decode_point
,
dilation_dict
=
dilation_dict
)
decode_shortcut
=
decode_shortcuts
[
decode_point
]
return
data
,
decode_shortcut
def
resnet_vd
(
input
):
# backbone: resnet_vd, 可选resnet_vd_50, resnet_vd_101
# end_points: resnet终止层数
...
...
@@ -299,10 +268,8 @@ def deeplabv3p(img, num_classes):
data
,
decode_shortcut
=
xception
(
img
)
elif
'mobilenet'
in
cfg
.
MODEL
.
DEEPLAB
.
BACKBONE
:
data
,
decode_shortcut
=
mobilenetv2
(
img
)
elif
'resnet_vd'
in
cfg
.
MODEL
.
DEEPLAB
.
BACKBONE
:
data
,
decode_shortcut
=
resnet_vd
(
img
)
elif
'resnet'
in
cfg
.
MODEL
.
DEEPLAB
.
BACKBONE
:
data
,
decode_shortcut
=
resnet
(
img
)
data
,
decode_shortcut
=
resnet
_vd
(
img
)
else
:
raise
Exception
(
"deeplab only support xception, mobilenet, resnet and resnet_vd backbone"
...
...
pdseg/utils/config.py
浏览文件 @
8393d05b
...
...
@@ -194,7 +194,7 @@ cfg.MODEL.FP16 = False
cfg
.
MODEL
.
SCALE_LOSS
=
"DYNAMIC"
########################## DeepLab模型配置 ####################################
# DeepLab backbone 配置, 可选项xception_65, xception_41, xception_71, mobilenetv2, resnet
_50, resnet_101, resnet_vd_50, resnet_vd_101
# DeepLab backbone 配置, 可选项xception_65, xception_41, xception_71, mobilenetv2, resnet
50_vd, resnet101_vd
cfg
.
MODEL
.
DEEPLAB
.
BACKBONE
=
"xception_65"
# DeepLab output stride
cfg
.
MODEL
.
DEEPLAB
.
OUTPUT_STRIDE
=
16
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录