Skip to content

Commit 56936b9

Browse files
committed
Refine doc for generate_proposals_op.
test=develop
1 parent 4801ee8 commit 56936b9

File tree

1 file changed

+36
-24
lines changed

1 file changed

+36
-24
lines changed

paddle/fluid/operators/detection/generate_proposals_op.cc

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -453,33 +453,45 @@ class GenerateProposalsKernel : public framework::OpKernel<T> {
453453
class GenerateProposalsOpMaker : public framework::OpProtoAndCheckerMaker {
454454
public:
455455
void Make() override {
456-
AddInput("Scores", "The scores of anchors should be foreground.");
457-
AddInput("BboxDeltas", "bbox_deltas.");
458-
AddInput("ImInfo", "Information for image reshape.");
459-
AddInput("Anchors", "All anchors.");
460-
AddInput("Variances", " variances");
461-
462-
AddOutput("RpnRois", "Anchors.");
463-
AddOutput("RpnRoiProbs", "Anchors.");
464-
AddAttr<int>("pre_nms_topN", "pre_nms_topN");
465-
AddAttr<int>("post_nms_topN", "post_nms_topN");
466-
AddAttr<float>("nms_thresh", "nms_thres");
467-
AddAttr<float>("min_size", "min size");
456+
AddInput("Scores",
457+
"(Tensor) The scores from conv is in shape (N, A, H, W), "
458+
"N is batch size, A is number of anchors, "
459+
"H and W are height and width of the feature map");
460+
AddInput("BboxDeltas",
461+
"(Tensor) Bounding box deltas from conv is in "
462+
"shape (N, 4*A, H, W).");
463+
AddInput("ImInfo",
464+
"(Tensor) Information for image reshape is in shape (N, 3), "
465+
"in format (height, width, scale)");
466+
AddInput("Anchors",
467+
"(Tensor) Bounding box anchors from anchor_generator_op "
468+
"is in shape (A, H, W, 4).");
469+
AddInput("Variances",
470+
"(Tensor) Bounding box variances with same shape as `Anchors`.");
471+
472+
AddOutput("RpnRois",
473+
"(LoDTensor), Output proposals with shape (rois_num, 4).");
474+
AddOutput("RpnRoiProbs",
475+
"(LoDTensor) Scores of proposals with shape (rois_num, 1).");
476+
AddAttr<int>("pre_nms_topN",
477+
"Number of top scoring RPN proposals to keep before "
478+
"applying NMS.");
479+
AddAttr<int>("post_nms_topN",
480+
"Number of top scoring RPN proposals to keep after "
481+
"applying NMS");
482+
AddAttr<float>("nms_thresh", "NMS threshold used on RPN proposals.");
483+
AddAttr<float>("min_size",
484+
"Proposal height and width both need to be greater "
485+
"than this min_size.");
468486
AddAttr<float>("eta", "The parameter for adaptive NMS.");
469487
AddComment(R"DOC(
470-
Generate Proposals OP
488+
This operator Generate bounding box proposals for Faster RCNN.
489+
The propoasls are generated for a list of images based on image
490+
score 'Scores', bounding box regression result 'BboxDeltas' as
491+
well as predefined bounding box shapes 'anchors'. Greedy
492+
non-maximum suppression is applied to generate the final bounding
493+
boxes.
471494
472-
This operator proposes rois according to each box with their probability to be a foreground object and
473-
the box can be calculated by anchors. Bbox_details and scores are the output of RPN. Final proposals
474-
could be used to train detection net.
475-
476-
Scores is the probability for each box to be an object. In format of (N, A, H, W) where N is batch size, A is number
477-
of anchors, H and W are height and width of the feature map.
478-
BboxDeltas is the differece between predicted box location and anchor location. In format of (N, 4*A, H, W)
479-
480-
For generating proposals, this operator transposes and resizes scores and bbox_deltas in size of (H*W*A, 1) and (H*W*A, 4) and
481-
calculate box locations as proposals candidates. Then clip boxes to image and remove predicted boxes with small area.
482-
Finally, apply nms to get final proposals as output.
483495
)DOC");
484496
}
485497
};

0 commit comments

Comments
 (0)