提交 2731fd96 编写于 作者: D dangqingqing

Update doc for multiclass_nms_op.

上级 73b66540
...@@ -37,13 +37,12 @@ class MulticlassNMSOp : public framework::OperatorWithKernel { ...@@ -37,13 +37,12 @@ class MulticlassNMSOp : public framework::OperatorWithKernel {
auto box_dims = ctx->GetInputDim("Bboxes"); auto box_dims = ctx->GetInputDim("Bboxes");
auto score_dims = ctx->GetInputDim("Scores"); auto score_dims = ctx->GetInputDim("Scores");
PADDLE_ENFORCE_EQ(box_dims.size(), 3, PADDLE_ENFORCE_EQ(box_dims.size(), 2,
"The rank of Input(Bboxes) must be 3."); "The rank of Input(Bboxes) must be 3.");
PADDLE_ENFORCE_EQ(score_dims.size(), 3, PADDLE_ENFORCE_EQ(score_dims.size(), 3,
"The rank of Input(Scores) must be 3."); "The rank of Input(Scores) must be 3.");
PADDLE_ENFORCE_EQ(box_dims[0], score_dims[0]);
PADDLE_ENFORCE_EQ(box_dims[2], 4); PADDLE_ENFORCE_EQ(box_dims[2], 4);
PADDLE_ENFORCE_EQ(box_dims[1], score_dims[2]); PADDLE_ENFORCE_EQ(box_dims[0], score_dims[2]);
// Here the box_dims[0] is not the real dimension of output. // Here the box_dims[0] is not the real dimension of output.
// It will be rewritten in the computing kernel. // It will be rewritten in the computing kernel.
...@@ -308,17 +307,19 @@ class MulticlassNMSOpMaker : public framework::OpProtoAndCheckerMaker { ...@@ -308,17 +307,19 @@ class MulticlassNMSOpMaker : public framework::OpProtoAndCheckerMaker {
.SetDefault(0.3); .SetDefault(0.3);
AddAttr<int64_t>("nms_top_k", AddAttr<int64_t>("nms_top_k",
"(int64_t) " "(int64_t) "
" ."); "Maximum number of results to be kept.");
AddAttr<float>("nms_eta", AddAttr<float>("nms_eta",
"(float) " "(float) "
"The parameter for adaptive nms.") "The parameter for adaptive nms.")
.SetDefault(1.0); .SetDefault(1.0);
AddAttr<int64_t>("keep_top_k", AddAttr<int64_t>("keep_top_k",
"(int64_t) " "(int64_t) "
"."); "Number of total bboxes to be kept per image after nms "
"step. -1 means keeping all bboxes after nms step.");
AddAttr<float>("confidence_threshold", AddAttr<float>("confidence_threshold",
"(float) " "(float) "
"."); "Only consider detections whose confidences are larger than "
"a threshold. If not provided, consider all boxes.");
AddOutput("Out", AddOutput("Out",
"(LoDTensor) A 2-D LoDTensor with shape [No, 6] represents the " "(LoDTensor) A 2-D LoDTensor with shape [No, 6] represents the "
"detections. Each row has 6 values: " "detections. Each row has 6 values: "
...@@ -328,15 +329,14 @@ class MulticlassNMSOpMaker : public framework::OpProtoAndCheckerMaker { ...@@ -328,15 +329,14 @@ class MulticlassNMSOpMaker : public framework::OpProtoAndCheckerMaker {
"offset is N + 1, if LoD[i + 1] - LoD[i] == 0, means there is " "offset is N + 1, if LoD[i + 1] - LoD[i] == 0, means there is "
"no detected bbox."); "no detected bbox.");
AddComment(R"DOC( AddComment(R"DOC(
This operators is to do multi-class non maximum suppression (nms) on a batched This operators is to do multi-class non maximum suppression (NMS) on a batched
of boxes and scores. of boxes and scores.
This op greedily selects a subset of detection bounding boxes, pruning This op greedily selects a subset of detection bounding boxes, pruning
away boxes that have high IOU (intersection over union) overlap (> thresh) away boxes that have high IOU (intersection over union) overlap (> thresh)
with already selected boxes. It operates independently for each class for with already selected boxes. It operates independently for each class for
which scores are provided (via the scores field of the input box_list), which scores are provided, pruning boxes with score less than a provided
pruning boxes with score less than a provided threshold prior to threshold prior to applying NMS.
applying NMS.
)DOC"); )DOC");
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册