ie_prior_box_layer.hpp
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include <builders/ie_layer_decorator.hpp>
8 #include <ie_network.hpp>
9 #include <string>
10 #include <vector>
11 
12 namespace InferenceEngine {
13 namespace Builder {
14 
15 /**
16  * @deprecated Use ngraph API instead.
17  * @brief The class represents a builder for PriorBox layer
18  */
19 IE_SUPPRESS_DEPRECATED_START
20 class INFERENCE_ENGINE_NN_BUILDER_API_CLASS(PriorBoxLayer): public LayerDecorator {
21 public:
22  /**
23  * @brief The constructor creates a builder with the name
24  * @param name Layer name
25  */
26  explicit PriorBoxLayer(const std::string& name = "");
27  /**
28  * @brief The constructor creates a builder from generic builder
29  * @param layer pointer to generic builder
30  */
31  explicit PriorBoxLayer(const Layer::Ptr& layer);
32  /**
33  * @brief The constructor creates a builder from generic builder
34  * @param layer constant pointer to generic builder
35  */
36  explicit PriorBoxLayer(const Layer::CPtr& layer);
37  /**
38  * @brief Sets the name for the layer
39  * @param name Layer name
40  * @return reference to layer builder
41  */
42  PriorBoxLayer& setName(const std::string& name);
43 
44  /**
45  * @brief Returns output port
46  * @return Output port
47  */
48  const Port& getOutputPort() const;
49  /**
50  * @brief Sets output port
51  * @param port Output port
52  * @return reference to layer builder
53  */
54  PriorBoxLayer& setOutputPort(const Port& port);
55  /**
56  * @brief Returns input ports
57  * @return Vector of input ports
58  */
59  const std::vector<Port>& getInputPorts() const;
60  /**
61  * @brief Sets input ports
62  * @param ports Vector of input ports
63  * @return reference to layer builder
64  */
65  PriorBoxLayer& setInputPorts(const std::vector<Port>& ports);
66  /**
67  * @brief Returns the minimum box size in pixels
68  * @return Minimum box size
69  */
70  size_t getMinSize() const;
71  /**
72  * @brief Sets the minimum box size in pixels
73  * @param minSize Minimum size
74  * @return reference to layer builder
75  */
76  PriorBoxLayer& setMinSize(size_t minSize);
77  /**
78  * @brief Returns the maximum box size in pixels
79  * @return maximum size
80  */
81  size_t getMaxSize() const;
82  /**
83  * @brief Sets the maximum box size in pixels
84  * @param maxSize Maximum size
85  * @return reference to layer builder
86  */
87  PriorBoxLayer& setMaxSize(size_t maxSize);
88  /**
89  * @brief Returns a distance between box centers
90  * @return Distance
91  */
92  float getStep() const;
93  /**
94  * @brief Sets a distance between box centers
95  * @param step Distance
96  * @return reference to layer builder
97  */
98  PriorBoxLayer& setStep(float step);
99  /**
100  * @brief Returns a shift of box respectively to top left corner
101  * @return Shift
102  */
103  float getOffset() const;
104  /**
105  * @brief Sets a shift of box respectively to top left corner
106  * @param offset Shift
107  * @return reference to layer builder
108  */
109  PriorBoxLayer& setOffset(float offset);
110  /**
111  * @brief Returns a variance of adjusting bounding boxes
112  * @return Variance
113  */
114  float getVariance() const;
115  /**
116  * @brief Sets a variance of adjusting bounding boxes
117  * @param variance Variance
118  * @return reference to layer builder
119  */
120  PriorBoxLayer& setVariance(float variance);
121  /**
122  * @brief Returns a flag that denotes type of inference
123  * @return true if max_size is used
124  */
125  bool getScaleAllSizes() const;
126  /**
127  * @brief Sets a flag that denotes a type of inference
128  * @param flag max_size is used if true
129  * @return reference to layer builder
130  */
131  PriorBoxLayer& setScaleAllSizes(bool flag);
132  /**
133  * @brief Returns clip flag
134  * @return true if each value in the output blob is within [0,1]
135  */
136  bool getClip() const;
137  /**
138  * @brief sets clip flag
139  * @param flag true if each value in the output blob is within [0,1]
140  * @return reference to layer builder
141  */
142  PriorBoxLayer& setClip(bool flag);
143  /**
144  * @brief Returns flip flag
145  * @return list of boxes is augmented with the flipped ones if true
146  */
147  bool getFlip() const;
148  /**
149  * @brief Sets flip flag
150  * @param flag true if list of boxes is augmented with the flipped ones
151  * @return reference to layer builder
152  */
153  PriorBoxLayer& setFlip(bool flag);
154  /**
155  * @brief Returns a variance of aspect ratios
156  * @return Vector of aspect ratios
157  */
158  const std::vector<size_t> getAspectRatio() const;
159  /**
160  * @brief Sets a variance of aspect ratios
161  * @param aspectRatio Vector of aspect ratios
162  * @return reference to layer builder
163  */
164  PriorBoxLayer& setAspectRatio(const std::vector<size_t>& aspectRatio);
165 };
166 IE_SUPPRESS_DEPRECATED_END
167 
168 } // namespace Builder
169 } // namespace InferenceEngine
Inference Engine API.
Definition: ie_argmax_layer.hpp:11