You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: python/paddle/fluid/layers/detection.py
+2-132Lines changed: 2 additions & 132 deletions
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,6 @@
39
39
from ..frameworkimportin_dygraph_mode
40
40
41
41
__all__= [
42
-
'prior_box',
43
42
'density_prior_box',
44
43
'multi_box_head',
45
44
'anchor_generator',
@@ -58,135 +57,6 @@
58
57
]
59
58
60
59
61
-
defprior_box(
62
-
input,
63
-
image,
64
-
min_sizes,
65
-
max_sizes=None,
66
-
aspect_ratios=[1.0],
67
-
variance=[0.1, 0.1, 0.2, 0.2],
68
-
flip=False,
69
-
clip=False,
70
-
steps=[0.0, 0.0],
71
-
offset=0.5,
72
-
name=None,
73
-
min_max_aspect_ratios_order=False,
74
-
):
75
-
"""
76
-
77
-
This op generates prior boxes for SSD(Single Shot MultiBox Detector) algorithm.
78
-
Each position of the input produce N prior boxes, N is determined by
79
-
the count of min_sizes, max_sizes and aspect_ratios, The size of the
80
-
box is in range(min_size, max_size) interval, which is generated in
81
-
sequence according to the aspect_ratios.
82
-
83
-
Parameters:
84
-
input(Variable): 4-D tensor(NCHW), the data type should be float32 or float64.
85
-
image(Variable): 4-D tensor(NCHW), the input image data of PriorBoxOp,
86
-
the data type should be float32 or float64.
87
-
min_sizes(list|tuple|float): the min sizes of generated prior boxes.
88
-
max_sizes(list|tuple|None): the max sizes of generated prior boxes.
89
-
Default: None.
90
-
aspect_ratios(list|tuple|float): the aspect ratios of generated
91
-
prior boxes. Default: [1.].
92
-
variance(list|tuple): the variances to be encoded in prior boxes.
93
-
Default:[0.1, 0.1, 0.2, 0.2].
94
-
flip(bool): Whether to flip aspect ratios. Default:False.
95
-
clip(bool): Whether to clip out-of-boundary boxes. Default: False.
96
-
step(list|tuple): Prior boxes step across width and height, If
97
-
step[0] equals to 0.0 or step[1] equals to 0.0, the prior boxes step across
98
-
height or weight of the input will be automatically calculated.
99
-
Default: [0., 0.]
100
-
offset(float): Prior boxes center offset. Default: 0.5
101
-
min_max_aspect_ratios_order(bool): If set True, the output prior box is
102
-
in order of [min, max, aspect_ratios], which is consistent with
103
-
Caffe. Please note, this order affects the weights order of
104
-
convolution layer followed by and does not affect the final
105
-
detection results. Default: False.
106
-
name(str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name`
107
-
108
-
Returns:
109
-
Tuple: A tuple with two Variable (boxes, variances)
110
-
111
-
boxes(Variable): the output prior boxes of PriorBox.
112
-
4-D tensor, the layout is [H, W, num_priors, 4].
113
-
H is the height of input, W is the width of input,
114
-
num_priors is the total box count of each position of input.
115
-
116
-
variances(Variable): the expanded variances of PriorBox.
117
-
4-D tensor, the layput is [H, W, num_priors, 4].
118
-
H is the height of input, W is the width of input
119
-
num_priors is the total box count of each position of input
0 commit comments