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