Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / include / builders / 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  * @brief The class represents a builder for PriorBox layer
17  */
18 class INFERENCE_ENGINE_API_CLASS(PriorBoxLayer): public LayerDecorator {
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 layer pointer to generic builder
28      */
29     explicit PriorBoxLayer(const Layer::Ptr& layer);
30     /**
31      * @brief The constructor creates a builder from generic builder
32      * @param layer constant pointer to generic builder
33      */
34     explicit PriorBoxLayer(const Layer::CPtr& layer);
35     /**
36      * @brief Sets the name for the layer
37      * @param name Layer name
38      * @return reference to layer builder
39      */
40     PriorBoxLayer& setName(const std::string& name);
41
42     /**
43      * @brief Returns output port
44      * @return Output port
45      */
46     const Port& getOutputPort() const;
47     /**
48      * @brief Sets output port
49      * @param port Output port
50      * @return reference to layer builder
51      */
52     PriorBoxLayer& setOutputPort(const Port& port);
53     /**
54      * @brief Returns input ports
55      * @return Vector of input ports
56      */
57     const std::vector<Port>& getInputPorts() const;
58     /**
59      * @brief Sets input ports
60      * @param ports Vector of input ports
61      * @return reference to layer builder
62      */
63     PriorBoxLayer& setInputPorts(const std::vector<Port>& ports);
64     /**
65      * @brief Returns the minimum box size in pixels
66      * @return Minimum box size
67      */
68     size_t getMinSize() const;
69     /**
70      * @brief Sets the minimum box size in pixels
71      * @param minSize Minimum size
72      * @return reference to layer builder
73      */
74     PriorBoxLayer& setMinSize(size_t minSize);
75     /**
76      * @brief Returns the maximum box size in pixels
77      * @return maximum size
78      */
79     size_t getMaxSize() const;
80     /**
81      * @brief Sets the maximum box size in pixels
82      * @param maxSize Maximum size
83      * @return reference to layer builder
84      */
85     PriorBoxLayer& setMaxSize(size_t maxSize);
86     /**
87      * @brief Returns a distance between box centers
88      * @return Distance
89      */
90     float getStep() const;
91     /**
92      * @brief Sets a distance between box centers
93      * @param step Distance
94      * @return reference to layer builder
95      */
96     PriorBoxLayer& setStep(float step);
97     /**
98      * @brief Returns a shift of box respectively to top left corner
99      * @return Shift
100      */
101     float getOffset() const;
102     /**
103      * @brief Sets a shift of box respectively to top left corner
104      * @param offset Shift
105      * @return reference to layer builder
106      */
107     PriorBoxLayer& setOffset(float offset);
108     /**
109      * @brief Returns a variance of adjusting bounding boxes
110      * @return Variance
111      */
112     float getVariance() const;
113     /**
114      * @brief Sets a variance of adjusting bounding boxes
115      * @param variance Variance
116      * @return reference to layer builder
117      */
118     PriorBoxLayer& setVariance(float variance);
119     /**
120      * @brief Returns a flag that denotes type of inference
121      * @return true if max_size is used
122      */
123     bool getScaleAllSizes() const;
124     /**
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
128      */
129     PriorBoxLayer& setScaleAllSizes(bool flag);
130     /**
131      * @brief Returns clip flag
132      * @return true if each value in the output blob is within [0,1]
133      */
134     bool getClip() const;
135     /**
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
139      */
140     PriorBoxLayer& setClip(bool flag);
141     /**
142      * @brief Returns flip flag
143      * @return list of boxes is augmented with the flipped ones if true
144      */
145     bool getFlip() const;
146     /**
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
150      */
151     PriorBoxLayer& setFlip(bool flag);
152     /**
153      * @brief Returns a variance of aspect ratios
154      * @return Vector of aspect ratios
155      */
156     const std::vector<size_t> getAspectRatio() const;
157     /**
158      * @brief Sets a variance of aspect ratios
159      * @param aspectRatio Vector of aspect ratios
160      * @return reference to layer builder
161      */
162     PriorBoxLayer& setAspectRatio(const std::vector<size_t>& aspectRatio);
163 };
164
165 }  // namespace Builder
166 }  // namespace InferenceEngine