ie_region_yolo_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 RegionYolo layer
18  */
19 IE_SUPPRESS_DEPRECATED_START
20 class INFERENCE_ENGINE_NN_BUILDER_API_CLASS(RegionYoloLayer): public LayerDecorator {
21 public:
22  /**
23  * @brief The constructor creates a builder with the name
24  * @param name Layer name
25  */
26  explicit RegionYoloLayer(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 RegionYoloLayer(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 RegionYoloLayer(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  RegionYoloLayer& setName(const std::string& name);
43 
44  /**
45  * @brief Returns input port
46  * @return Input port
47  */
48  const Port& getInputPort() const;
49  /**
50  * @brief Sets input port
51  * @param port Input port
52  * @return reference to layer builder
53  */
54  RegionYoloLayer& setInputPort(const Port& port);
55  /**
56  * @brief Returns output port
57  * @return Output port
58  */
59  const Port& getOutputPort() const;
60  /**
61  * @brief Sets output port
62  * @param port Output port
63  * @return reference to layer builder
64  */
65  RegionYoloLayer& setOutputPort(const Port& port);
66  /**
67  * @brief Returns number of coordinates for each region
68  * @return Number of coordinates
69  */
70  int getCoords() const;
71  /**
72  * @brief Sets number of coordinates for each region
73  * @param coords Number of coordinates
74  * @return reference to layer builder
75  */
76  RegionYoloLayer& setCoords(int coords);
77  /**
78  * @brief Returns number of classes for each region
79  * @return Number of classes
80  */
81  int getClasses() const;
82  /**
83  * @brief Sets number of classes for each region
84  * @param classes number of classes
85  * @return reference to layer builder
86  */
87  RegionYoloLayer& setClasses(int classes);
88  /**
89  * @brief Returns number of regions
90  * @return Number of regions
91  */
92  int getNum() const;
93  /**
94  * @brief Sets number of regions
95  * @param num Number of regions
96  * @return reference to layer builder
97  */
98  RegionYoloLayer& setNum(int num);
99  /**
100  * @brief Returns a flag which specifies the method of infer
101  * @return true if softmax is performed
102  */
103  bool getDoSoftMax() const;
104  /**
105  * @brief Sets a flag which specifies the method of infer
106  * @param flag softmax is performed if true
107  * @return reference to layer builder
108  */
109  RegionYoloLayer& setDoSoftMax(bool flag);
110  /**
111  * @brief Returns anchors coordinates of regions
112  * @return anchors coordinates
113  */
114  float getAnchors() const;
115  /**
116  * @brief Sets anchors coordinates of regions
117  * @param anchors Anchors coordinates
118  * @return reference to layer builder
119  */
120  RegionYoloLayer& setAnchors(float anchors);
121  /**
122  * @brief Returns mask
123  * @return Mask
124  */
125  int getMask() const;
126  /**
127  * @brief Sets mask
128  * @param mask Specifies which anchors to use
129  * @return reference to layer builder
130  */
131  RegionYoloLayer& setMask(int mask);
132  /**
133  * @brief Returns the number of the dimension from which flattening is performed
134  * @return Axis
135  */
136  size_t getAxis() const;
137  /**
138  * @brief Sets the number of the dimension from which flattening is performed
139  * @param axis Axis
140  * @return reference to layer builder
141  */
142  RegionYoloLayer& setAxis(size_t axis);
143  /**
144  * @brief Returns the number of the dimension on which flattening is ended
145  * @return End axis
146  */
147  size_t getEndAxis() const;
148  /**
149  * @brief Sets the number of the dimension on which flattening is ended
150  * @param axis End axis
151  * @return reference to layer builder
152  */
153  RegionYoloLayer& setEndAxis(size_t axis);
154 };
155 IE_SUPPRESS_DEPRECATED_END
156 
157 } // namespace Builder
158 } // namespace InferenceEngine
Inference Engine API.
Definition: ie_argmax_layer.hpp:11