Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
1f82ad23
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
1f82ad23
编写于
2月 11, 2021
作者:
G
Guanghua Yu
提交者:
GitHub
2月 11, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix solov2 with_background & from_config (#2211)
上级
3a77e318
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
23 addition
and
13 deletion
+23
-13
dygraph/configs/solov2/_base_/solov2_r50_fpn.yml
dygraph/configs/solov2/_base_/solov2_r50_fpn.yml
+0
-6
dygraph/ppdet/data/transform/batch_operator.py
dygraph/ppdet/data/transform/batch_operator.py
+1
-1
dygraph/ppdet/modeling/architectures/solov2.py
dygraph/ppdet/modeling/architectures/solov2.py
+20
-4
dygraph/ppdet/modeling/heads/solov2_head.py
dygraph/ppdet/modeling/heads/solov2_head.py
+1
-1
dygraph/ppdet/py_op/post_process.py
dygraph/ppdet/py_op/post_process.py
+1
-1
未找到文件。
dygraph/configs/solov2/_base_/solov2_r50_fpn.yml
浏览文件 @
1f82ad23
...
@@ -9,7 +9,6 @@ SOLOv2:
...
@@ -9,7 +9,6 @@ SOLOv2:
mask_head
:
SOLOv2MaskHead
mask_head
:
SOLOv2MaskHead
ResNet
:
ResNet
:
# index 0 stands for res2
depth
:
50
depth
:
50
norm_type
:
bn
norm_type
:
bn
freeze_at
:
0
freeze_at
:
0
...
@@ -17,11 +16,7 @@ ResNet:
...
@@ -17,11 +16,7 @@ ResNet:
num_stages
:
4
num_stages
:
4
FPN
:
FPN
:
in_channels
:
[
256
,
512
,
1024
,
2048
]
out_channel
:
256
out_channel
:
256
min_level
:
0
max_level
:
4
spatial_scale
:
[
0.25
,
0.125
,
0.0625
,
0.03125
]
SOLOv2Head
:
SOLOv2Head
:
seg_feat_channels
:
512
seg_feat_channels
:
512
...
@@ -32,7 +27,6 @@ SOLOv2Head:
...
@@ -32,7 +27,6 @@ SOLOv2Head:
mask_nms
:
MaskMatrixNMS
mask_nms
:
MaskMatrixNMS
SOLOv2MaskHead
:
SOLOv2MaskHead
:
in_channels
:
256
mid_channels
:
128
mid_channels
:
128
out_channels
:
256
out_channels
:
256
start_level
:
0
start_level
:
0
...
...
dygraph/ppdet/data/transform/batch_operator.py
浏览文件 @
1f82ad23
...
@@ -644,7 +644,7 @@ class Gt2Solov2TargetOp(BaseOperator):
...
@@ -644,7 +644,7 @@ class Gt2Solov2TargetOp(BaseOperator):
max_ins_num
=
[
0
]
*
len
(
self
.
num_grids
)
max_ins_num
=
[
0
]
*
len
(
self
.
num_grids
)
for
sample
in
samples
:
for
sample
in
samples
:
gt_bboxes_raw
=
sample
[
'gt_bbox'
]
gt_bboxes_raw
=
sample
[
'gt_bbox'
]
gt_labels_raw
=
sample
[
'gt_class'
]
gt_labels_raw
=
sample
[
'gt_class'
]
+
1
im_c
,
im_h
,
im_w
=
sample
[
'image'
].
shape
[:]
im_c
,
im_h
,
im_w
=
sample
[
'image'
].
shape
[:]
gt_masks_raw
=
sample
[
'gt_segm'
].
astype
(
np
.
uint8
)
gt_masks_raw
=
sample
[
'gt_segm'
].
astype
(
np
.
uint8
)
mask_feat_size
=
[
mask_feat_size
=
[
...
...
dygraph/ppdet/modeling/architectures/solov2.py
浏览文件 @
1f82ad23
...
@@ -18,7 +18,7 @@ from __future__ import print_function
...
@@ -18,7 +18,7 @@ from __future__ import print_function
import
paddle
import
paddle
from
ppdet.core.workspace
import
register
from
ppdet.core.workspace
import
register
,
create
from
.meta_arch
import
BaseArch
from
.meta_arch
import
BaseArch
__all__
=
[
'SOLOv2'
]
__all__
=
[
'SOLOv2'
]
...
@@ -37,7 +37,6 @@ class SOLOv2(BaseArch):
...
@@ -37,7 +37,6 @@ class SOLOv2(BaseArch):
"""
"""
__category__
=
'architecture'
__category__
=
'architecture'
__inject__
=
[
'backbone'
,
'neck'
,
'solov2_head'
,
'mask_head'
]
def
__init__
(
self
,
backbone
,
solov2_head
,
mask_head
,
neck
=
None
):
def
__init__
(
self
,
backbone
,
solov2_head
,
mask_head
,
neck
=
None
):
super
(
SOLOv2
,
self
).
__init__
()
super
(
SOLOv2
,
self
).
__init__
()
...
@@ -46,11 +45,28 @@ class SOLOv2(BaseArch):
...
@@ -46,11 +45,28 @@ class SOLOv2(BaseArch):
self
.
solov2_head
=
solov2_head
self
.
solov2_head
=
solov2_head
self
.
mask_head
=
mask_head
self
.
mask_head
=
mask_head
@
classmethod
def
from_config
(
cls
,
cfg
,
*
args
,
**
kwargs
):
backbone
=
create
(
cfg
[
'backbone'
])
kwargs
=
{
'input_shape'
:
backbone
.
out_shape
}
neck
=
create
(
cfg
[
'neck'
],
**
kwargs
)
kwargs
=
{
'input_shape'
:
neck
.
out_shape
}
solov2_head
=
create
(
cfg
[
'solov2_head'
],
**
kwargs
)
mask_head
=
create
(
cfg
[
'mask_head'
],
**
kwargs
)
return
{
'backbone'
:
backbone
,
'neck'
:
neck
,
'solov2_head'
:
solov2_head
,
'mask_head'
:
mask_head
,
}
def
model_arch
(
self
):
def
model_arch
(
self
):
body_feats
=
self
.
backbone
(
self
.
inputs
)
body_feats
=
self
.
backbone
(
self
.
inputs
)
if
self
.
neck
is
not
None
:
body_feats
=
self
.
neck
(
body_feats
)
body_feats
,
spatial_scale
=
self
.
neck
(
body_feats
)
self
.
seg_pred
=
self
.
mask_head
(
body_feats
)
self
.
seg_pred
=
self
.
mask_head
(
body_feats
)
...
...
dygraph/ppdet/modeling/heads/solov2_head.py
浏览文件 @
1f82ad23
...
@@ -190,7 +190,7 @@ class SOLOv2Head(nn.Layer):
...
@@ -190,7 +190,7 @@ class SOLOv2Head(nn.Layer):
self
.
num_classes
=
num_classes
self
.
num_classes
=
num_classes
self
.
in_channels
=
in_channels
self
.
in_channels
=
in_channels
self
.
seg_num_grids
=
num_grids
self
.
seg_num_grids
=
num_grids
self
.
cate_out_channels
=
self
.
num_classes
-
1
self
.
cate_out_channels
=
self
.
num_classes
self
.
seg_feat_channels
=
seg_feat_channels
self
.
seg_feat_channels
=
seg_feat_channels
self
.
stacked_convs
=
stacked_convs
self
.
stacked_convs
=
stacked_convs
self
.
kernel_out_channels
=
kernel_out_channels
self
.
kernel_out_channels
=
kernel_out_channels
...
...
dygraph/ppdet/py_op/post_process.py
浏览文件 @
1f82ad23
...
@@ -87,7 +87,7 @@ def get_solov2_segm_res(results, image_id, num_id_to_cat_id_map):
...
@@ -87,7 +87,7 @@ def get_solov2_segm_res(results, image_id, num_id_to_cat_id_map):
return
None
return
None
# for each sample
# for each sample
for
i
in
range
(
lengths
-
1
):
for
i
in
range
(
lengths
-
1
):
clsid
=
int
(
clsid_labels
[
i
])
+
1
clsid
=
int
(
clsid_labels
[
i
])
catid
=
num_id_to_cat_id_map
[
clsid
]
catid
=
num_id_to_cat_id_map
[
clsid
]
score
=
float
(
clsid_scores
[
i
])
score
=
float
(
clsid_scores
[
i
])
mask
=
segms
[
i
]
mask
=
segms
[
i
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录