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