Skip to content

Commit e0708e6

Browse files
committed
refine code
1 parent 1c591c3 commit e0708e6

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

paddle/fluid/operators/detection/rpn_target_assign_op.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ class RpnTargetAssignOp : public framework::OperatorWithKernel {
5353
ctx->HasOutput("TargetBBox"),
5454
"Output(TargetBBox) of RpnTargetAssignOp should not be null");
5555
PADDLE_ENFORCE(
56-
ctx->HasOutput("BBox_inside_weight"),
57-
"Output(BBox_inside_weight) of RpnTargetAssignOp should not be null");
56+
ctx->HasOutput("BBoxInsideWeight"),
57+
"Output(BBoxInsideWeight) of RpnTargetAssignOp should not be null");
5858

5959
auto anchor_dims = ctx->GetInputDim("Anchor");
6060
auto gt_boxes_dims = ctx->GetInputDim("GtBoxes");
@@ -71,7 +71,7 @@ class RpnTargetAssignOp : public framework::OperatorWithKernel {
7171
ctx->SetOutputDim("ScoreIndex", {-1});
7272
ctx->SetOutputDim("TargetLabel", {-1, 1});
7373
ctx->SetOutputDim("TargetBBox", {-1, 4});
74-
ctx->SetOutputDim("BBox_inside_weight", {-1, 4});
74+
ctx->SetOutputDim("BBoxInsideWeight", {-1, 4});
7575
}
7676

7777
protected:
@@ -345,7 +345,7 @@ class RpnTargetAssignKernel : public framework::OpKernel<T> {
345345
auto* score_index = context.Output<LoDTensor>("ScoreIndex");
346346
auto* tgt_bbox = context.Output<LoDTensor>("TargetBBox");
347347
auto* tgt_lbl = context.Output<LoDTensor>("TargetLabel");
348-
auto* bbox_inside_weight = context.Output<LoDTensor>("BBox_inside_weight");
348+
auto* bbox_inside_weight = context.Output<LoDTensor>("BBoxInsideWeight");
349349

350350
PADDLE_ENFORCE_EQ(gt_boxes->lod().size(), 1UL,
351351
"RpnTargetAssignOp gt_boxes needs 1 level of LoD");
@@ -547,7 +547,7 @@ class RpnTargetAssignOpMaker : public framework::OpProtoAndCheckerMaker {
547547
"TargetLabel",
548548
"(Tensor<int>), The target labels of each anchor with shape "
549549
"[F + B, 1], F and B are sampled foreground and backgroud number.");
550-
AddOutput("BBox_inside_weight",
550+
AddOutput("BBoxInsideWeight",
551551
"(Tensor), The bbox inside weight with shape "
552552
"[F, 4], F is the sampled foreground number.");
553553
AddComment(R"DOC(

python/paddle/fluid/layers/detection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def rpn_target_assign(bbox_pred,
167167
'ScoreIndex': score_index,
168168
'TargetLabel': target_label,
169169
'TargetBBox': target_bbox,
170-
'BBox_inside_weight': bbox_inside_weight
170+
'BBoxInsideWeight': bbox_inside_weight
171171
},
172172
attrs={
173173
'rpn_batch_size_per_im': rpn_batch_size_per_im,

python/paddle/fluid/tests/test_detection.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ def test_rpn_target_assign(self):
324324
assert pred_scores.shape[1] == 1
325325
assert pred_loc.shape[1] == 4
326326
assert pred_loc.shape[1] == tgt_bbox.shape[1]
327+
print(str(program))
327328

328329

329330
class TestGenerateProposals(unittest.TestCase):

python/paddle/fluid/tests/unittests/test_rpn_target_assign_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ def setUp(self):
227227
'ScoreIndex': score_index.astype('int32'),
228228
'TargetBBox': tgt_bbox.astype('float32'),
229229
'TargetLabel': labels.astype('int32'),
230-
'BBox_inside_weight': bbox_inside_weights.astype('float32')
230+
'BBoxInsideWeight': bbox_inside_weights.astype('float32')
231231
}
232232

233233
def test_check_output(self):

0 commit comments

Comments
 (0)