Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
e0708e62
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e0708e62
编写于
10月 23, 2018
作者:
J
jerrywgz
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine code
上级
1c591c39
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
8 addition
and
7 deletion
+8
-7
paddle/fluid/operators/detection/rpn_target_assign_op.cc
paddle/fluid/operators/detection/rpn_target_assign_op.cc
+5
-5
python/paddle/fluid/layers/detection.py
python/paddle/fluid/layers/detection.py
+1
-1
python/paddle/fluid/tests/test_detection.py
python/paddle/fluid/tests/test_detection.py
+1
-0
python/paddle/fluid/tests/unittests/test_rpn_target_assign_op.py
...paddle/fluid/tests/unittests/test_rpn_target_assign_op.py
+1
-1
未找到文件。
paddle/fluid/operators/detection/rpn_target_assign_op.cc
浏览文件 @
e0708e62
...
@@ -53,8 +53,8 @@ class RpnTargetAssignOp : public framework::OperatorWithKernel {
...
@@ -53,8 +53,8 @@ class RpnTargetAssignOp : public framework::OperatorWithKernel {
ctx
->
HasOutput
(
"TargetBBox"
),
ctx
->
HasOutput
(
"TargetBBox"
),
"Output(TargetBBox) of RpnTargetAssignOp should not be null"
);
"Output(TargetBBox) of RpnTargetAssignOp should not be null"
);
PADDLE_ENFORCE
(
PADDLE_ENFORCE
(
ctx
->
HasOutput
(
"BBox
_inside_w
eight"
),
ctx
->
HasOutput
(
"BBox
InsideW
eight"
),
"Output(BBox
_inside_w
eight) of RpnTargetAssignOp should not be null"
);
"Output(BBox
InsideW
eight) of RpnTargetAssignOp should not be null"
);
auto
anchor_dims
=
ctx
->
GetInputDim
(
"Anchor"
);
auto
anchor_dims
=
ctx
->
GetInputDim
(
"Anchor"
);
auto
gt_boxes_dims
=
ctx
->
GetInputDim
(
"GtBoxes"
);
auto
gt_boxes_dims
=
ctx
->
GetInputDim
(
"GtBoxes"
);
...
@@ -71,7 +71,7 @@ class RpnTargetAssignOp : public framework::OperatorWithKernel {
...
@@ -71,7 +71,7 @@ class RpnTargetAssignOp : public framework::OperatorWithKernel {
ctx
->
SetOutputDim
(
"ScoreIndex"
,
{
-
1
});
ctx
->
SetOutputDim
(
"ScoreIndex"
,
{
-
1
});
ctx
->
SetOutputDim
(
"TargetLabel"
,
{
-
1
,
1
});
ctx
->
SetOutputDim
(
"TargetLabel"
,
{
-
1
,
1
});
ctx
->
SetOutputDim
(
"TargetBBox"
,
{
-
1
,
4
});
ctx
->
SetOutputDim
(
"TargetBBox"
,
{
-
1
,
4
});
ctx
->
SetOutputDim
(
"BBox
_inside_w
eight"
,
{
-
1
,
4
});
ctx
->
SetOutputDim
(
"BBox
InsideW
eight"
,
{
-
1
,
4
});
}
}
protected:
protected:
...
@@ -345,7 +345,7 @@ class RpnTargetAssignKernel : public framework::OpKernel<T> {
...
@@ -345,7 +345,7 @@ class RpnTargetAssignKernel : public framework::OpKernel<T> {
auto
*
score_index
=
context
.
Output
<
LoDTensor
>
(
"ScoreIndex"
);
auto
*
score_index
=
context
.
Output
<
LoDTensor
>
(
"ScoreIndex"
);
auto
*
tgt_bbox
=
context
.
Output
<
LoDTensor
>
(
"TargetBBox"
);
auto
*
tgt_bbox
=
context
.
Output
<
LoDTensor
>
(
"TargetBBox"
);
auto
*
tgt_lbl
=
context
.
Output
<
LoDTensor
>
(
"TargetLabel"
);
auto
*
tgt_lbl
=
context
.
Output
<
LoDTensor
>
(
"TargetLabel"
);
auto
*
bbox_inside_weight
=
context
.
Output
<
LoDTensor
>
(
"BBox
_inside_w
eight"
);
auto
*
bbox_inside_weight
=
context
.
Output
<
LoDTensor
>
(
"BBox
InsideW
eight"
);
PADDLE_ENFORCE_EQ
(
gt_boxes
->
lod
().
size
(),
1UL
,
PADDLE_ENFORCE_EQ
(
gt_boxes
->
lod
().
size
(),
1UL
,
"RpnTargetAssignOp gt_boxes needs 1 level of LoD"
);
"RpnTargetAssignOp gt_boxes needs 1 level of LoD"
);
...
@@ -547,7 +547,7 @@ class RpnTargetAssignOpMaker : public framework::OpProtoAndCheckerMaker {
...
@@ -547,7 +547,7 @@ class RpnTargetAssignOpMaker : public framework::OpProtoAndCheckerMaker {
"TargetLabel"
,
"TargetLabel"
,
"(Tensor<int>), The target labels of each anchor with shape "
"(Tensor<int>), The target labels of each anchor with shape "
"[F + B, 1], F and B are sampled foreground and backgroud number."
);
"[F + B, 1], F and B are sampled foreground and backgroud number."
);
AddOutput
(
"BBox
_inside_w
eight"
,
AddOutput
(
"BBox
InsideW
eight"
,
"(Tensor), The bbox inside weight with shape "
"(Tensor), The bbox inside weight with shape "
"[F, 4], F is the sampled foreground number."
);
"[F, 4], F is the sampled foreground number."
);
AddComment
(
R"DOC(
AddComment
(
R"DOC(
...
...
python/paddle/fluid/layers/detection.py
浏览文件 @
e0708e62
...
@@ -167,7 +167,7 @@ def rpn_target_assign(bbox_pred,
...
@@ -167,7 +167,7 @@ def rpn_target_assign(bbox_pred,
'ScoreIndex'
:
score_index
,
'ScoreIndex'
:
score_index
,
'TargetLabel'
:
target_label
,
'TargetLabel'
:
target_label
,
'TargetBBox'
:
target_bbox
,
'TargetBBox'
:
target_bbox
,
'BBox
_inside_w
eight'
:
bbox_inside_weight
'BBox
InsideW
eight'
:
bbox_inside_weight
},
},
attrs
=
{
attrs
=
{
'rpn_batch_size_per_im'
:
rpn_batch_size_per_im
,
'rpn_batch_size_per_im'
:
rpn_batch_size_per_im
,
...
...
python/paddle/fluid/tests/test_detection.py
浏览文件 @
e0708e62
...
@@ -324,6 +324,7 @@ class TestRpnTargetAssign(unittest.TestCase):
...
@@ -324,6 +324,7 @@ class TestRpnTargetAssign(unittest.TestCase):
assert
pred_scores
.
shape
[
1
]
==
1
assert
pred_scores
.
shape
[
1
]
==
1
assert
pred_loc
.
shape
[
1
]
==
4
assert
pred_loc
.
shape
[
1
]
==
4
assert
pred_loc
.
shape
[
1
]
==
tgt_bbox
.
shape
[
1
]
assert
pred_loc
.
shape
[
1
]
==
tgt_bbox
.
shape
[
1
]
print
(
str
(
program
))
class
TestGenerateProposals
(
unittest
.
TestCase
):
class
TestGenerateProposals
(
unittest
.
TestCase
):
...
...
python/paddle/fluid/tests/unittests/test_rpn_target_assign_op.py
浏览文件 @
e0708e62
...
@@ -227,7 +227,7 @@ class TestRpnTargetAssignOp(OpTest):
...
@@ -227,7 +227,7 @@ class TestRpnTargetAssignOp(OpTest):
'ScoreIndex'
:
score_index
.
astype
(
'int32'
),
'ScoreIndex'
:
score_index
.
astype
(
'int32'
),
'TargetBBox'
:
tgt_bbox
.
astype
(
'float32'
),
'TargetBBox'
:
tgt_bbox
.
astype
(
'float32'
),
'TargetLabel'
:
labels
.
astype
(
'int32'
),
'TargetLabel'
:
labels
.
astype
(
'int32'
),
'BBox
_inside_w
eight'
:
bbox_inside_weights
.
astype
(
'float32'
)
'BBox
InsideW
eight'
:
bbox_inside_weights
.
astype
(
'float32'
)
}
}
def
test_check_output
(
self
):
def
test_check_output
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录