@@ -54,11 +54,17 @@ def detection_output(loc,
54
54
score_threshold = 0.01 ,
55
55
nms_eta = 1.0 ):
56
56
"""
57
- **Detection Output Layer**
57
+ **Detection Output Layer for Single Shot Multibox Detector (SSD). **
58
58
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.
62
68
63
69
Args:
64
70
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
91
97
nms_eta(float): The parameter for adaptive NMS.
92
98
93
99
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.
95
109
96
110
Examples:
97
111
.. code-block:: python
0 commit comments