Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSeg
提交
5977ae40
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看板
提交
5977ae40
编写于
9月 22, 2020
作者:
M
michaelowenliu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add feat_channels in backbone
上级
7dac6524
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
27 addition
and
29 deletion
+27
-29
dygraph/paddleseg/models/backbones/resnet_vd.py
dygraph/paddleseg/models/backbones/resnet_vd.py
+4
-6
dygraph/paddleseg/models/danet.py
dygraph/paddleseg/models/danet.py
+1
-1
dygraph/paddleseg/models/deeplab.py
dygraph/paddleseg/models/deeplab.py
+21
-21
dygraph/paddleseg/models/ocrnet.py
dygraph/paddleseg/models/ocrnet.py
+1
-1
未找到文件。
dygraph/paddleseg/models/backbones/resnet_vd.py
浏览文件 @
5977ae40
...
@@ -224,8 +224,8 @@ class ResNet_vd(nn.Layer):
...
@@ -224,8 +224,8 @@ class ResNet_vd(nn.Layer):
]
if
layers
>=
50
else
[
64
,
64
,
128
,
256
]
]
if
layers
>=
50
else
[
64
,
64
,
128
,
256
]
num_filters
=
[
64
,
128
,
256
,
512
]
num_filters
=
[
64
,
128
,
256
,
512
]
# for channels of
returned stage
# for channels of
four returned stages
self
.
backbone
_channels
=
[
c
*
4
for
c
in
num_filters
self
.
feat
_channels
=
[
c
*
4
for
c
in
num_filters
]
if
layers
>=
50
else
num_filters
]
if
layers
>=
50
else
num_filters
dilation_dict
=
None
dilation_dict
=
None
...
@@ -338,8 +338,6 @@ class ResNet_vd(nn.Layer):
...
@@ -338,8 +338,6 @@ class ResNet_vd(nn.Layer):
return
feat_list
return
feat_list
@
manager
.
BACKBONES
.
add_component
@
manager
.
BACKBONES
.
add_component
def
ResNet18_vd
(
**
args
):
def
ResNet18_vd
(
**
args
):
model
=
ResNet_vd
(
layers
=
18
,
**
args
)
model
=
ResNet_vd
(
layers
=
18
,
**
args
)
...
...
dygraph/paddleseg/models/danet.py
浏览文件 @
5977ae40
...
@@ -190,7 +190,7 @@ class DANet(nn.Layer):
...
@@ -190,7 +190,7 @@ class DANet(nn.Layer):
self
.
backbone
=
backbone
self
.
backbone
=
backbone
self
.
backbone_indices
=
backbone_indices
self
.
backbone_indices
=
backbone_indices
in_channels
=
[
self
.
backbone
.
channels
[
i
]
for
i
in
backbone_indices
]
in_channels
=
[
self
.
backbone
.
feat_
channels
[
i
]
for
i
in
backbone_indices
]
self
.
head
=
DAHead
(
num_classes
=
num_classes
,
in_channels
=
in_channels
)
self
.
head
=
DAHead
(
num_classes
=
num_classes
,
in_channels
=
in_channels
)
...
...
dygraph/paddleseg/models/deeplab.py
浏览文件 @
5977ae40
...
@@ -62,13 +62,12 @@ class DeepLabV3P(nn.Layer):
...
@@ -62,13 +62,12 @@ class DeepLabV3P(nn.Layer):
super
(
DeepLabV3P
,
self
).
__init__
()
super
(
DeepLabV3P
,
self
).
__init__
()
self
.
backbone
=
backbone
self
.
backbone
=
backbone
backbone_channels
=
backbone
.
backbone_channels
backbone_channels
=
[
backbone
.
feat_channels
[
i
]
for
i
in
backbone_indices
]
self
.
head
=
DeepLabV3PHead
(
self
.
head
=
DeepLabV3PHead
(
num_classes
,
backbone_indices
,
num_classes
,
backbone_channels
,
aspp_ratios
,
backbone_indices
,
backbone_channels
,
aspp_ratios
,
aspp_out_channels
)
aspp_out_channels
)
utils
.
load_entire_model
(
self
,
pretrained
)
utils
.
load_entire_model
(
self
,
pretrained
)
...
@@ -81,6 +80,7 @@ class DeepLabV3P(nn.Layer):
...
@@ -81,6 +80,7 @@ class DeepLabV3P(nn.Layer):
F
.
resize_bilinear
(
logit
,
input
.
shape
[
2
:])
for
logit
in
logit_list
F
.
resize_bilinear
(
logit
,
input
.
shape
[
2
:])
for
logit
in
logit_list
]
]
class
DeepLabV3PHead
(
nn
.
Layer
):
class
DeepLabV3PHead
(
nn
.
Layer
):
"""
"""
The DeepLabV3PHead implementation based on PaddlePaddle.
The DeepLabV3PHead implementation based on PaddlePaddle.
...
@@ -113,11 +113,11 @@ class DeepLabV3PHead(nn.Layer):
...
@@ -113,11 +113,11 @@ class DeepLabV3PHead(nn.Layer):
self
.
aspp
=
pyramid_pool
.
ASPPModule
(
self
.
aspp
=
pyramid_pool
.
ASPPModule
(
aspp_ratios
,
aspp_ratios
,
backbone_channels
[
backbone_indices
[
1
]
],
backbone_channels
[
1
],
aspp_out_channels
,
aspp_out_channels
,
sep_conv
=
True
,
sep_conv
=
True
,
image_pooling
=
True
)
image_pooling
=
True
)
self
.
decoder
=
Decoder
(
num_classes
,
backbone_channels
[
backbone_indices
[
0
]
])
self
.
decoder
=
Decoder
(
num_classes
,
backbone_channels
[
0
])
self
.
backbone_indices
=
backbone_indices
self
.
backbone_indices
=
backbone_indices
self
.
init_weight
()
self
.
init_weight
()
...
@@ -135,6 +135,7 @@ class DeepLabV3PHead(nn.Layer):
...
@@ -135,6 +135,7 @@ class DeepLabV3PHead(nn.Layer):
def
init_weight
(
self
):
def
init_weight
(
self
):
pass
pass
@
manager
.
MODELS
.
add_component
@
manager
.
MODELS
.
add_component
class
DeepLabV3
(
nn
.
Layer
):
class
DeepLabV3
(
nn
.
Layer
):
"""
"""
...
@@ -159,13 +160,12 @@ class DeepLabV3(nn.Layer):
...
@@ -159,13 +160,12 @@ class DeepLabV3(nn.Layer):
super
(
DeepLabV3
,
self
).
__init__
()
super
(
DeepLabV3
,
self
).
__init__
()
self
.
backbone
=
backbone
self
.
backbone
=
backbone
backbone_channels
=
backbone
.
backbone_channels
backbone_channels
=
[
backbone
.
feat_channels
[
i
]
for
i
in
backbone_indices
]
self
.
head
=
DeepLabV3Head
(
self
.
head
=
DeepLabV3Head
(
num_classes
,
backbone_indices
,
num_classes
,
backbone_channels
,
aspp_ratios
,
backbone_indices
,
backbone_channels
,
aspp_ratios
,
aspp_out_channels
)
aspp_out_channels
)
utils
.
load_entire_model
(
self
,
pretrained
)
utils
.
load_entire_model
(
self
,
pretrained
)
...
@@ -191,13 +191,13 @@ class DeepLabV3Head(nn.Layer):
...
@@ -191,13 +191,13 @@ class DeepLabV3Head(nn.Layer):
self
.
aspp
=
pyramid_pool
.
ASPPModule
(
self
.
aspp
=
pyramid_pool
.
ASPPModule
(
aspp_ratios
,
aspp_ratios
,
backbone_channels
[
backbone_indices
[
0
]
],
backbone_channels
[
0
],
aspp_out_channels
,
aspp_out_channels
,
sep_conv
=
False
,
sep_conv
=
False
,
image_pooling
=
True
)
image_pooling
=
True
)
self
.
cls
=
nn
.
Conv2d
(
self
.
cls
=
nn
.
Conv2d
(
in_channels
=
backbone_channels
[
backbone_indices
[
0
]
],
in_channels
=
backbone_channels
[
0
],
out_channels
=
num_classes
,
out_channels
=
num_classes
,
kernel_size
=
1
)
kernel_size
=
1
)
...
...
dygraph/paddleseg/models/ocrnet.py
浏览文件 @
5977ae40
...
@@ -203,7 +203,7 @@ class OCRNet(nn.Layer):
...
@@ -203,7 +203,7 @@ class OCRNet(nn.Layer):
self
.
backbone
=
backbone
self
.
backbone
=
backbone
self
.
backbone_indices
=
backbone_indices
self
.
backbone_indices
=
backbone_indices
in_channels
=
[
self
.
backbone
.
channels
[
i
]
for
i
in
backbone_indices
]
in_channels
=
[
self
.
backbone
.
feat_
channels
[
i
]
for
i
in
backbone_indices
]
self
.
head
=
OCRHead
(
self
.
head
=
OCRHead
(
num_classes
=
num_classes
,
num_classes
=
num_classes
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录