From 2731fd96606b18411b485269e36fd44ae8909650 Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Tue, 30 Jan 2018 00:19:28 +0800 Subject: [PATCH] Update doc for multiclass_nms_op. --- paddle/operators/multiclass_nms_op.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/paddle/operators/multiclass_nms_op.cc b/paddle/operators/multiclass_nms_op.cc index 19c5b7efd6b..5da553a6cc2 100644 --- a/paddle/operators/multiclass_nms_op.cc +++ b/paddle/operators/multiclass_nms_op.cc @@ -37,13 +37,12 @@ class MulticlassNMSOp : public framework::OperatorWithKernel { auto box_dims = ctx->GetInputDim("Bboxes"); 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."); PADDLE_ENFORCE_EQ(score_dims.size(), 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[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. // It will be rewritten in the computing kernel. @@ -308,17 +307,19 @@ class MulticlassNMSOpMaker : public framework::OpProtoAndCheckerMaker { .SetDefault(0.3); AddAttr("nms_top_k", "(int64_t) " - " ."); + "Maximum number of results to be kept."); AddAttr("nms_eta", "(float) " "The parameter for adaptive nms.") .SetDefault(1.0); AddAttr("keep_top_k", "(int64_t) " - "."); + "Number of total bboxes to be kept per image after nms " + "step. -1 means keeping all bboxes after nms step."); AddAttr("confidence_threshold", "(float) " - "."); + "Only consider detections whose confidences are larger than " + "a threshold. If not provided, consider all boxes."); AddOutput("Out", "(LoDTensor) A 2-D LoDTensor with shape [No, 6] represents the " "detections. Each row has 6 values: " @@ -328,15 +329,14 @@ class MulticlassNMSOpMaker : public framework::OpProtoAndCheckerMaker { "offset is N + 1, if LoD[i + 1] - LoD[i] == 0, means there is " "no detected bbox."); 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. This op greedily selects a subset of detection bounding boxes, pruning away boxes that have high IOU (intersection over union) overlap (> thresh) with already selected boxes. It operates independently for each class for -which scores are provided (via the scores field of the input box_list), -pruning boxes with score less than a provided threshold prior to -applying NMS. +which scores are provided, pruning boxes with score less than a provided +threshold prior to applying NMS. )DOC"); } -- GitLab