|
|
@ -43,7 +43,7 @@ class BoxCoderOp : public framework::OperatorWithKernel {
|
|
|
|
if (prior_box_var_dims.size() == 1) {
|
|
|
|
if (prior_box_var_dims.size() == 1) {
|
|
|
|
PADDLE_ENFORCE_EQ(
|
|
|
|
PADDLE_ENFORCE_EQ(
|
|
|
|
prior_box_var_dims[0], 4,
|
|
|
|
prior_box_var_dims[0], 4,
|
|
|
|
"The 1st dimension of Input(PriorBoxVar) should be 1"
|
|
|
|
"The 1st dimension of Input(PriorBoxVar) should be 4"
|
|
|
|
"when the rank is 1.");
|
|
|
|
"when the rank is 1.");
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
PADDLE_ENFORCE_EQ(
|
|
|
|
PADDLE_ENFORCE_EQ(
|
|
|
@ -52,9 +52,9 @@ class BoxCoderOp : public framework::OperatorWithKernel {
|
|
|
|
"the dimension of Input(PriorBox when the rank is 2.)");
|
|
|
|
"the dimension of Input(PriorBox when the rank is 2.)");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
auto code_type =
|
|
|
|
auto code_type = GetBoxCodeType(ctx->Attrs().Get<std::string>("code_type"));
|
|
|
|
GetBoxCodeType(ctx->Attrs().Get<std::string>("code_type"));
|
|
|
|
|
|
|
|
int axis = ctx->Attrs().Get<int>("axis");
|
|
|
|
int axis = ctx->Attrs().Get<int>("axis");
|
|
|
|
if (code_type == BoxCodeType::kEncodeCenterSize) {
|
|
|
|
if (code_type == BoxCodeType::kEncodeCenterSize) {
|
|
|
|
PADDLE_ENFORCE_EQ(target_box_dims.size(), 2,
|
|
|
|
PADDLE_ENFORCE_EQ(target_box_dims.size(), 2,
|
|
|
@ -84,7 +84,6 @@ class BoxCoderOp : public framework::OperatorWithKernel {
|
|
|
|
ctx->ShareLoD("TargetBox", /*->*/ "OutputBox");
|
|
|
|
ctx->ShareLoD("TargetBox", /*->*/ "OutputBox");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class BoxCoderOpMaker : public framework::OpProtoAndCheckerMaker {
|
|
|
|
class BoxCoderOpMaker : public framework::OpProtoAndCheckerMaker {
|
|
|
|