ie_detection_output_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 Detection Output layer
22  */
23 
24 IE_SUPPRESS_DEPRECATED_START
25 class INFERENCE_ENGINE_NN_BUILDER_API_CLASS(DetectionOutputLayer): public LayerDecorator {
26 public:
27  /**
28  * @brief The constructor creates a builder with the name
29  * @param name Layer name
30  */
31  explicit DetectionOutputLayer(const std::string& name = "");
32  /**
33  * @brief The constructor creates a builder from generic builder
34  * @param layer pointer to generic builder
35  */
36  explicit DetectionOutputLayer(const Layer::Ptr& layer);
37  /**
38  * @brief The constructor creates a builder from generic builder
39  * @param layer constant pointer to generic builder
40  */
41  explicit DetectionOutputLayer(const Layer::CPtr& layer);
42  /**
43  * @brief Sets the name for the layer
44  * @param name Layer name
45  * @return reference to layer builder
46  */
47  DetectionOutputLayer& setName(const std::string& name);
48 
49  /**
50  * @brief Returns output port
51  * @return Output port
52  */
53  const Port& getOutputPort() const;
54  /**
55  * @brief Sets output port
56  * @param port Output port
57  * @return reference to layer builder
58  */
59  DetectionOutputLayer& setOutputPort(const Port& port);
60  /**
61  * @brief Returns input ports
62  * @return Vector of input ports
63  */
64  const std::vector<Port>& getInputPorts() const;
65  /**
66  * @brief Sets input ports
67  * @param ports Vector of input ports
68  * @return reference to layer builder
69  */
70  DetectionOutputLayer& setInputPorts(const std::vector<Port>& ports);
71  /**
72  * @brief Returns number of classes
73  * @return Number of classes
74  */
75  size_t getNumClasses() const;
76  /**
77  * @brief Sets number of classes to be predict
78  * @param num Number of classes
79  * @return reference to layer builder
80  */
81  DetectionOutputLayer& setNumClasses(size_t num);
82  /**
83  * @brief Returns background label ID
84  * @return Background ID
85  */
86  int getBackgroudLabelId() const;
87  /**
88  * @brief Sets background label ID
89  * @param labelId Background ID if there is no background class, set it to -1.
90  * @return reference to layer builder
91  */
92  DetectionOutputLayer& setBackgroudLabelId(int labelId);
93  /**
94  * @brief Returns maximum number of results to be kept on NMS stage
95  * @return Top K
96  */
97  int getTopK() const;
98  /**
99  * @brief Sets maximum number of results to be kept on NMS stage
100  * @param topK Top K
101  * @return reference to layer builder
102  */
103  DetectionOutputLayer& setTopK(int topK);
104  /**
105  * @brief Returns number of total boxes to be kept per image after NMS step
106  * @return Keep top K
107  */
108  int getKeepTopK() const;
109  /**
110  * @brief Sets number of total boxes to be kept per image after NMS step
111  * @param topK Keep top K
112  * @return reference to layer builder
113  */
114  DetectionOutputLayer& setKeepTopK(int topK);
115  /**
116  * @brief Returns number of oriented classes
117  * @return Number of oriented classes
118  */
119  int getNumOrientClasses() const;
120  /**
121  * @brief Sets number of oriented classes
122  * @param numClasses Number of classes
123  * @return reference to layer builder
124  */
125  DetectionOutputLayer& setNumOrientClasses(int numClasses);
126  /**
127  * @brief Returns type of coding method for bounding boxes
128  * @return String with code type
129  */
130  std::string getCodeType() const;
131  /**
132  * @brief Sets type of coding method for bounding boxes
133  * @param type Type
134  * @return reference to layer builder
135  */
136  DetectionOutputLayer& setCodeType(std::string type);
137  /**
138  * @brief Returns interpolate orientation
139  * @return Interpolate orientation
140  */
141  int getInterpolateOrientation() const;
142  /**
143  * @brief Sets interpolate orientation
144  * @param orient Orientation
145  * @return reference to layer builder
146  */
147  DetectionOutputLayer& setInterpolateOrientation(int orient);
148  /**
149  * @brief Returns threshold to be used in NMS stage
150  * @return Threshold
151  */
152  float getNMSThreshold() const;
153  /**
154  * @brief Sets threshold to be used in NMS stage
155  * @param threshold NMS threshold
156  * @return reference to layer builder
157  */
158  DetectionOutputLayer& setNMSThreshold(float threshold);
159  /**
160  * @brief Returns confidence threshold
161  * @return Threshold
162  */
163  float getConfidenceThreshold() const;
164  /**
165  * @brief Sets confidence threshold
166  * @param threshold Threshold
167  * @return reference to layer builder
168  */
169  DetectionOutputLayer& setConfidenceThreshold(float threshold);
170  /**
171  * @brief Returns share location
172  * @return true if bounding boxes are shared among different classes
173  */
174  bool getShareLocation() const;
175  /**
176  * @brief Sets share location
177  * @param flag true if bounding boxes are shared among different classes
178  * @return reference to layer builder
179  */
180  DetectionOutputLayer& setShareLocation(bool flag);
181  /**
182  * @brief Returns encoded settings
183  * @return true if variance is encoded in target
184  */
185  bool getVariantEncodedInTarget() const;
186  /**
187  * @brief Sets encoded settings
188  * @param flag true if variance is encoded in target
189  * @return reference to layer builder
190  */
191  DetectionOutputLayer& setVariantEncodedInTarget(bool flag);
192 };
193 IE_SUPPRESS_DEPRECATED_END
194 
195 } // namespace Builder
196 } // namespace InferenceEngine
Inference Engine API.
Definition: ie_argmax_layer.hpp:15
The class represents a builder for Detection Output layer.
Definition: ie_detection_output_layer.hpp:25
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
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
std::string type
Layer type.
Definition: ie_layers.h:47