1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
7 #include <builders/ie_layer_decorator.hpp>
8 #include <ie_network.hpp>
12 namespace InferenceEngine {
16 * @brief The class represents a builder for PriorBox layer
18 class INFERENCE_ENGINE_API_CLASS(PriorBoxLayer): public LayerDecorator {
21 * @brief The constructor creates a builder with the name
22 * @param name Layer name
24 explicit PriorBoxLayer(const std::string& name = "");
26 * @brief The constructor creates a builder from generic builder
27 * @param layer pointer to generic builder
29 explicit PriorBoxLayer(const Layer::Ptr& layer);
31 * @brief The constructor creates a builder from generic builder
32 * @param layer constant pointer to generic builder
34 explicit PriorBoxLayer(const Layer::CPtr& layer);
36 * @brief Sets the name for the layer
37 * @param name Layer name
38 * @return reference to layer builder
40 PriorBoxLayer& setName(const std::string& name);
43 * @brief Returns output port
46 const Port& getOutputPort() const;
48 * @brief Sets output port
49 * @param port Output port
50 * @return reference to layer builder
52 PriorBoxLayer& setOutputPort(const Port& port);
54 * @brief Returns input ports
55 * @return Vector of input ports
57 const std::vector<Port>& getInputPorts() const;
59 * @brief Sets input ports
60 * @param ports Vector of input ports
61 * @return reference to layer builder
63 PriorBoxLayer& setInputPorts(const std::vector<Port>& ports);
65 * @brief Returns the minimum box size in pixels
66 * @return Minimum box size
68 size_t getMinSize() const;
70 * @brief Sets the minimum box size in pixels
71 * @param minSize Minimum size
72 * @return reference to layer builder
74 PriorBoxLayer& setMinSize(size_t minSize);
76 * @brief Returns the maximum box size in pixels
77 * @return maximum size
79 size_t getMaxSize() const;
81 * @brief Sets the maximum box size in pixels
82 * @param maxSize Maximum size
83 * @return reference to layer builder
85 PriorBoxLayer& setMaxSize(size_t maxSize);
87 * @brief Returns a distance between box centers
90 float getStep() const;
92 * @brief Sets a distance between box centers
93 * @param step Distance
94 * @return reference to layer builder
96 PriorBoxLayer& setStep(float step);
98 * @brief Returns a shift of box respectively to top left corner
101 float getOffset() const;
103 * @brief Sets a shift of box respectively to top left corner
104 * @param offset Shift
105 * @return reference to layer builder
107 PriorBoxLayer& setOffset(float offset);
109 * @brief Returns a variance of adjusting bounding boxes
112 float getVariance() const;
114 * @brief Sets a variance of adjusting bounding boxes
115 * @param variance Variance
116 * @return reference to layer builder
118 PriorBoxLayer& setVariance(float variance);
120 * @brief Returns a flag that denotes type of inference
121 * @return true if max_size is used
123 bool getScaleAllSizes() const;
125 * @brief Sets a flag that denotes a type of inference
126 * @param flag max_size is used if true
127 * @return reference to layer builder
129 PriorBoxLayer& setScaleAllSizes(bool flag);
131 * @brief Returns clip flag
132 * @return true if each value in the output blob is within [0,1]
134 bool getClip() const;
136 * @brief sets clip flag
137 * @param flag true if each value in the output blob is within [0,1]
138 * @return reference to layer builder
140 PriorBoxLayer& setClip(bool flag);
142 * @brief Returns flip flag
143 * @return list of boxes is augmented with the flipped ones if true
145 bool getFlip() const;
147 * @brief Sets flip flag
148 * @param flag true if list of boxes is augmented with the flipped ones
149 * @return reference to layer builder
151 PriorBoxLayer& setFlip(bool flag);
153 * @brief Returns a variance of aspect ratios
154 * @return Vector of aspect ratios
156 const std::vector<size_t> getAspectRatio() const;
158 * @brief Sets a variance of aspect ratios
159 * @param aspectRatio Vector of aspect ratios
160 * @return reference to layer builder
162 PriorBoxLayer& setAspectRatio(const std::vector<size_t>& aspectRatio);
165 } // namespace Builder
166 } // namespace InferenceEngine