Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
ee078f8f
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ee078f8f
编写于
6月 26, 2019
作者:
J
jerrywgz
提交者:
GitHub
6月 26, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug in mask rcnn architecture (#2560)
上级
6b296d73
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
15 deletion
+23
-15
PaddleCV/object_detection/configs/mask_rcnn_se154_vd_fpn_s1x.yml
...V/object_detection/configs/mask_rcnn_se154_vd_fpn_s1x.yml
+3
-3
PaddleCV/object_detection/ppdet/modeling/architectures/mask_rcnn.py
...bject_detection/ppdet/modeling/architectures/mask_rcnn.py
+20
-12
未找到文件。
PaddleCV/object_detection/configs/mask_rcnn_se154_fpn_s1x.yml
→
PaddleCV/object_detection/configs/mask_rcnn_se154_
vd_
fpn_s1x.yml
浏览文件 @
ee078f8f
...
...
@@ -8,7 +8,7 @@ use_gpu: True
log_smooth_window
:
20
save_dir
:
output
pretrain_weights
:
https://paddle-imagenet-models-name.bj.bcebos.com/SE154_vd_pretrained.tar
weights
:
output/mask_rcnn_se154_fpn_s1x/model_final/
weights
:
output/mask_rcnn_se154_
vd_
fpn_s1x/model_final/
metric
:
COCO
MaskRCNN
:
...
...
@@ -51,13 +51,13 @@ FPNRPNHead:
train_proposal
:
min_size
:
0.0
nms_thresh
:
0.7
post_nms_top_n
:
2000
pre_nms_top_n
:
2000
post_nms_top_n
:
2000
test_proposal
:
min_size
:
0.0
nms_thresh
:
0.7
post_nms_top_n
:
1000
pre_nms_top_n
:
1000
post_nms_top_n
:
1000
FPNRoIAlign
:
canconical_level
:
4
...
...
PaddleCV/object_detection/ppdet/modeling/architectures/mask_rcnn.py
浏览文件 @
ee078f8f
...
...
@@ -67,8 +67,9 @@ class MaskRCNN(object):
assert
mode
in
[
'train'
,
'test'
],
\
"only 'train' and 'test' mode is supported"
if
mode
==
'train'
:
required_fields
=
[
'gt_label'
,
'gt_box'
,
'gt_mask'
,
'is_crowd'
,
'im_info'
]
required_fields
=
[
'gt_label'
,
'gt_box'
,
'gt_mask'
,
'is_crowd'
,
'im_info'
]
else
:
required_fields
=
[
'im_shape'
,
'im_info'
]
for
var
in
required_fields
:
...
...
@@ -85,12 +86,6 @@ class MaskRCNN(object):
# RPN proposals
rois
=
self
.
rpn_head
.
get_proposals
(
body_feats
,
im_info
,
mode
=
mode
)
if
self
.
fpn
is
None
:
last_feat
=
body_feats
[
list
(
body_feats
.
keys
())[
-
1
]]
roi_feat
=
self
.
roi_extractor
(
last_feat
,
rois
)
else
:
roi_feat
=
self
.
roi_extractor
(
body_feats
,
rois
,
spatial_scale
)
if
mode
==
'train'
:
rpn_loss
=
self
.
rpn_head
.
get_loss
(
im_info
,
feed_vars
[
'gt_box'
],
feed_vars
[
'is_crowd'
])
...
...
@@ -104,6 +99,12 @@ class MaskRCNN(object):
rois
=
outs
[
0
]
labels_int32
=
outs
[
1
]
if
self
.
fpn
is
None
:
last_feat
=
body_feats
[
list
(
body_feats
.
keys
())[
-
1
]]
roi_feat
=
self
.
roi_extractor
(
last_feat
,
rois
)
else
:
roi_feat
=
self
.
roi_extractor
(
body_feats
,
rois
,
spatial_scale
)
loss
=
self
.
bbox_head
.
get_loss
(
roi_feat
,
labels_int32
,
*
outs
[
2
:])
loss
.
update
(
rpn_loss
)
...
...
@@ -118,8 +119,8 @@ class MaskRCNN(object):
bbox_head_feat
=
self
.
bbox_head
.
get_head_feat
()
feat
=
fluid
.
layers
.
gather
(
bbox_head_feat
,
roi_has_mask_int32
)
else
:
feat
=
self
.
roi_extractor
(
body_feats
,
mask_rois
,
spatial_scale
,
is_mask
=
True
)
feat
=
self
.
roi_extractor
(
body_feats
,
mask_rois
,
spatial_scale
,
is_mask
=
True
)
mask_loss
=
self
.
mask_head
.
get_loss
(
feat
,
mask_int32
)
loss
.
update
(
mask_loss
)
...
...
@@ -129,6 +130,13 @@ class MaskRCNN(object):
return
loss
else
:
if
self
.
fpn
is
None
:
last_feat
=
body_feats
[
list
(
body_feats
.
keys
())[
-
1
]]
roi_feat
=
self
.
roi_extractor
(
last_feat
,
rois
)
else
:
roi_feat
=
self
.
roi_extractor
(
body_feats
,
rois
,
spatial_scale
)
bbox_pred
=
self
.
bbox_head
.
get_prediction
(
roi_feat
,
rois
,
im_info
,
feed_vars
[
'im_shape'
])
bbox_pred
=
bbox_pred
[
'bbox'
]
...
...
@@ -147,8 +155,8 @@ class MaskRCNN(object):
with
switch
.
case
(
cond
):
fluid
.
layers
.
assign
(
input
=
bbox_pred
,
output
=
mask_pred
)
with
switch
.
default
():
bbox
=
fluid
.
layers
.
slice
(
bbox_pred
,
[
1
],
starts
=
[
2
],
ends
=
[
6
])
bbox
=
fluid
.
layers
.
slice
(
bbox_pred
,
[
1
],
starts
=
[
2
],
ends
=
[
6
])
im_scale
=
fluid
.
layers
.
slice
(
im_info
,
[
1
],
starts
=
[
2
],
ends
=
[
3
])
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录