Skip to content

Commit bbf98a0

Browse files
authored
Refine the doc in detection_output API. (#8689)
* Refine the doc in detection_output API. * Refine the doc.
1 parent bb60e92 commit bbf98a0

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

python/paddle/fluid/layers/detection.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,17 @@ def detection_output(loc,
5454
score_threshold=0.01,
5555
nms_eta=1.0):
5656
"""
57-
**Detection Output Layer**
57+
**Detection Output Layer for Single Shot Multibox Detector (SSD).**
5858
59-
This layer applies the NMS to the output of network and computes the
60-
predict bounding box location. The output's shape of this layer could
61-
be zero if there is no valid bounding box.
59+
This operation is to get the detection results by performing following
60+
two steps:
61+
62+
1. Decode input bounding box predictions according to the prior boxes.
63+
2. Get the final detection results by applying multi-class non maximum
64+
suppression (NMS).
65+
66+
Please note, this operation doesn't clip the final output bounding boxes
67+
to the image window.
6268
6369
Args:
6470
loc(Variable): A 3-D Tensor with shape [N, M, 4] represents the
@@ -91,7 +97,15 @@ class number, M is number of bounding boxes. For each category
9197
nms_eta(float): The parameter for adaptive NMS.
9298
9399
Returns:
94-
The detected bounding boxes which are a Tensor.
100+
Variable: The detection outputs is a LoDTensor with shape [No, 6].
101+
Each row has six values: [label, confidence, xmin, ymin, xmax, ymax].
102+
`No` is the total number of detections in this mini-batch. For each
103+
instance, the offsets in first dimension are called LoD, the offset
104+
number is N + 1, N is the batch size. The i-th image has
105+
`LoD[i + 1] - LoD[i]` detected results, if it is 0, the i-th image
106+
has no detected results. If all images have not detected results,
107+
all the elements in LoD are 0, and output tensor only contains one
108+
value, which is -1.
95109
96110
Examples:
97111
.. code-block:: python

0 commit comments

Comments
 (0)