Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
s920243400
PaddleDetection
提交
ed6b5e99
P
PaddleDetection
项目概览
s920243400
/
PaddleDetection
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleDetection
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
ed6b5e99
编写于
2月 10, 2021
作者:
W
wangguanzhong
提交者:
GitHub
2月 10, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix mask rcnn, test=dygraph (#2208)
上级
926efec2
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
9 addition
and
7 deletion
+9
-7
dygraph/configs/faster_rcnn/_base_/faster_rcnn_r50.yml
dygraph/configs/faster_rcnn/_base_/faster_rcnn_r50.yml
+1
-1
dygraph/configs/mask_rcnn/_base_/mask_rcnn_r50.yml
dygraph/configs/mask_rcnn/_base_/mask_rcnn_r50.yml
+1
-1
dygraph/ppdet/modeling/backbones/resnet.py
dygraph/ppdet/modeling/backbones/resnet.py
+1
-1
dygraph/ppdet/modeling/bbox_utils.py
dygraph/ppdet/modeling/bbox_utils.py
+2
-2
dygraph/ppdet/modeling/heads/bbox_head.py
dygraph/ppdet/modeling/heads/bbox_head.py
+1
-1
dygraph/ppdet/modeling/heads/cascade_head.py
dygraph/ppdet/modeling/heads/cascade_head.py
+1
-0
dygraph/ppdet/modeling/proposal_generator/rpn_head.py
dygraph/ppdet/modeling/proposal_generator/rpn_head.py
+0
-1
dygraph/ppdet/py_op/post_process.py
dygraph/ppdet/py_op/post_process.py
+2
-0
未找到文件。
dygraph/configs/faster_rcnn/_base_/faster_rcnn_r50.yml
浏览文件 @
ed6b5e99
...
@@ -34,7 +34,7 @@ RPNHead:
...
@@ -34,7 +34,7 @@ RPNHead:
nms_thresh
:
0.7
nms_thresh
:
0.7
pre_nms_top_n
:
12000
pre_nms_top_n
:
12000
post_nms_top_n
:
2000
post_nms_top_n
:
2000
topk_after_collect
:
Tru
e
topk_after_collect
:
Fals
e
test_proposal
:
test_proposal
:
min_size
:
0.0
min_size
:
0.0
nms_thresh
:
0.7
nms_thresh
:
0.7
...
...
dygraph/configs/mask_rcnn/_base_/mask_rcnn_r50.yml
浏览文件 @
ed6b5e99
...
@@ -35,7 +35,7 @@ RPNHead:
...
@@ -35,7 +35,7 @@ RPNHead:
nms_thresh
:
0.7
nms_thresh
:
0.7
pre_nms_top_n
:
12000
pre_nms_top_n
:
12000
post_nms_top_n
:
2000
post_nms_top_n
:
2000
topk_after_collect
:
Tru
e
topk_after_collect
:
Fals
e
test_proposal
:
test_proposal
:
min_size
:
0.0
min_size
:
0.0
nms_thresh
:
0.7
nms_thresh
:
0.7
...
...
dygraph/ppdet/modeling/backbones/resnet.py
浏览文件 @
ed6b5e99
...
@@ -555,7 +555,7 @@ class Res5Head(nn.Layer):
...
@@ -555,7 +555,7 @@ class Res5Head(nn.Layer):
def
out_shape
(
self
):
def
out_shape
(
self
):
return
[
ShapeSpec
(
return
[
ShapeSpec
(
channels
=
self
.
feat_out
,
channels
=
self
.
feat_out
,
stride
=
32
,
)]
stride
=
16
,
)]
def
forward
(
self
,
roi_feat
,
stage
=
0
):
def
forward
(
self
,
roi_feat
,
stage
=
0
):
y
=
self
.
res5
(
roi_feat
)
y
=
self
.
res5
(
roi_feat
)
...
...
dygraph/ppdet/modeling/bbox_utils.py
浏览文件 @
ed6b5e99
...
@@ -50,7 +50,7 @@ def delta2bbox(deltas, boxes, weights):
...
@@ -50,7 +50,7 @@ def delta2bbox(deltas, boxes, weights):
dy
=
deltas
[:,
1
::
4
]
/
wy
dy
=
deltas
[:,
1
::
4
]
/
wy
dw
=
deltas
[:,
2
::
4
]
/
ww
dw
=
deltas
[:,
2
::
4
]
/
ww
dh
=
deltas
[:,
3
::
4
]
/
wh
dh
=
deltas
[:,
3
::
4
]
/
wh
# Prevent sending too large values into
np
.exp()
# Prevent sending too large values into
paddle
.exp()
dw
=
paddle
.
clip
(
dw
,
max
=
clip_scale
)
dw
=
paddle
.
clip
(
dw
,
max
=
clip_scale
)
dh
=
paddle
.
clip
(
dh
,
max
=
clip_scale
)
dh
=
paddle
.
clip
(
dh
,
max
=
clip_scale
)
...
@@ -64,7 +64,7 @@ def delta2bbox(deltas, boxes, weights):
...
@@ -64,7 +64,7 @@ def delta2bbox(deltas, boxes, weights):
pred_boxes
.
append
(
pred_ctr_y
-
0.5
*
pred_h
)
pred_boxes
.
append
(
pred_ctr_y
-
0.5
*
pred_h
)
pred_boxes
.
append
(
pred_ctr_x
+
0.5
*
pred_w
)
pred_boxes
.
append
(
pred_ctr_x
+
0.5
*
pred_w
)
pred_boxes
.
append
(
pred_ctr_y
+
0.5
*
pred_h
)
pred_boxes
.
append
(
pred_ctr_y
+
0.5
*
pred_h
)
pred_boxes
=
paddle
.
concat
(
pred_boxes
,
axis
=-
1
)
pred_boxes
=
paddle
.
stack
(
pred_boxes
,
axis
=-
1
)
return
pred_boxes
return
pred_boxes
...
...
dygraph/ppdet/modeling/heads/bbox_head.py
浏览文件 @
ed6b5e99
...
@@ -128,7 +128,7 @@ class BBoxHead(nn.Layer):
...
@@ -128,7 +128,7 @@ class BBoxHead(nn.Layer):
def
forward
(
self
,
body_feats
=
None
,
rois
=
None
,
rois_num
=
None
,
inputs
=
None
):
def
forward
(
self
,
body_feats
=
None
,
rois
=
None
,
rois_num
=
None
,
inputs
=
None
):
"""
"""
body_feats (list[Tensor]): Feature maps from backbone
body_feats (list[Tensor]): Feature maps from backbone
rois (
Tensor
): RoIs generated from RPN module
rois (
list[Tensor]
): RoIs generated from RPN module
rois_num (Tensor): The number of RoIs in each image
rois_num (Tensor): The number of RoIs in each image
inputs (dict{Tensor}): The ground-truth of image
inputs (dict{Tensor}): The ground-truth of image
"""
"""
...
...
dygraph/ppdet/modeling/heads/cascade_head.py
浏览文件 @
ed6b5e99
...
@@ -187,6 +187,7 @@ class CascadeHead(BBoxHead):
...
@@ -187,6 +187,7 @@ class CascadeHead(BBoxHead):
pred_proposals
=
paddle
.
concat
(
proposals
)
if
len
(
pred_proposals
=
paddle
.
concat
(
proposals
)
if
len
(
proposals
)
>
1
else
proposals
[
0
]
proposals
)
>
1
else
proposals
[
0
]
pred_bbox
=
delta2bbox
(
deltas
,
pred_proposals
,
weights
)
pred_bbox
=
delta2bbox
(
deltas
,
pred_proposals
,
weights
)
pred_bbox
=
paddle
.
reshape
(
pred_bbox
,
[
-
1
,
deltas
.
shape
[
-
1
]])
num_prop
=
[
p
.
shape
[
0
]
for
p
in
proposals
]
num_prop
=
[
p
.
shape
[
0
]
for
p
in
proposals
]
return
pred_bbox
.
split
(
num_prop
)
return
pred_bbox
.
split
(
num_prop
)
...
...
dygraph/ppdet/modeling/proposal_generator/rpn_head.py
浏览文件 @
ed6b5e99
...
@@ -116,7 +116,6 @@ class RPNHead(nn.Layer):
...
@@ -116,7 +116,6 @@ class RPNHead(nn.Layer):
rois
,
rois_num
=
self
.
_gen_proposal
(
scores
,
deltas
,
anchors
,
inputs
,
rois
,
rois_num
=
self
.
_gen_proposal
(
scores
,
deltas
,
anchors
,
inputs
,
batch_size
)
batch_size
)
if
self
.
training
:
if
self
.
training
:
loss
=
self
.
get_loss
(
scores
,
deltas
,
anchors
,
inputs
)
loss
=
self
.
get_loss
(
scores
,
deltas
,
anchors
,
inputs
)
return
rois
,
rois_num
,
loss
return
rois
,
rois_num
,
loss
...
...
dygraph/ppdet/py_op/post_process.py
浏览文件 @
ed6b5e99
...
@@ -55,6 +55,8 @@ def get_seg_res(masks, bboxes, mask_nums, image_id, label_to_cat_id_map):
...
@@ -55,6 +55,8 @@ def get_seg_res(masks, bboxes, mask_nums, image_id, label_to_cat_id_map):
score
=
float
(
bboxes
[
k
][
1
])
score
=
float
(
bboxes
[
k
][
1
])
label
=
int
(
bboxes
[
k
][
0
])
label
=
int
(
bboxes
[
k
][
0
])
k
=
k
+
1
k
=
k
+
1
if
label
==
-
1
:
continue
cat_id
=
label_to_cat_id_map
[
label
]
cat_id
=
label_to_cat_id_map
[
label
]
rle
=
mask_util
.
encode
(
rle
=
mask_util
.
encode
(
np
.
array
(
np
.
array
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录