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