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