ie_simpler_nms_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 SimplerNMS layer
18  */
19 IE_SUPPRESS_DEPRECATED_START
20 class INFERENCE_ENGINE_NN_BUILDER_API_CLASS(SimplerNMSLayer): public LayerDecorator {
21 public:
22  /**
23  * @brief The constructor creates a builder with the name
24  * @param name Layer name
25  */
26  explicit SimplerNMSLayer(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 SimplerNMSLayer(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 SimplerNMSLayer(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  SimplerNMSLayer& setName(const std::string& name);
43 
44  /**
45  * @brief Returns input ports
46  * @return Vector of input ports
47  */
48  const std::vector<Port>& getInputPorts() const;
49  /**
50  * @brief Sets input ports
51  * @param ports Vector of input ports
52  */
53  SimplerNMSLayer& setInputPorts(const std::vector<Port>& ports);
54  /**
55  * @brief Returns output port
56  * @return Output port
57  */
58  const Port& getOutputPort() const;
59  /**
60  * @brief Sets output port
61  * @param port Output port
62  * @return reference to layer builder
63  */
64  SimplerNMSLayer& setOutputPort(const Port& port);
65  /**
66  * @brief Returns the quantity of bounding boxes before applying NMS
67  * @return Quantity of bounding boxes
68  */
69  size_t getPreNMSTopN() const;
70  /**
71  * @brief Sets the quantity of bounding boxes before applying NMS
72  * @param topN Quantity of bounding boxes
73  * @return reference to layer builder
74  */
75  SimplerNMSLayer& setPreNMSTopN(size_t topN);
76  /**
77  * @brief Returns the quantity of bounding boxes after applying NMS
78  * @return Quantity of bounding boxes
79  */
80  size_t getPostNMSTopN() const;
81  /**
82  * @brief Sets the quantity of bounding boxes after applying NMS
83  * @param topN Quantity of bounding boxes
84  * @return reference to layer builder
85  */
86  SimplerNMSLayer& setPostNMSTopN(size_t topN);
87  /**
88  * @brief Returns the step size to slide over boxes in pixels
89  * @return Step size
90  */
91  size_t getFeatStride() const;
92  /**
93  * @brief Sets the step size to slide over boxes in pixels
94  * @param featStride Step size
95  * @return reference to layer builder
96  */
97  SimplerNMSLayer& setFeatStride(size_t featStride);
98  /**
99  * @brief Returns the minimum size of box to be taken into consideration
100  * @return Minimum size
101  */
102  size_t getMinBoxSize() const;
103  /**
104  * @brief Sets the minimum size of box to be taken into consideration
105  * @param minSize Minimum size
106  * @return reference to layer builder
107  */
108  SimplerNMSLayer& setMinBoxSize(size_t minSize);
109  /**
110  * @brief Returns scale for anchor boxes generating
111  * @return Scale for anchor boxes
112  */
113  size_t getScale() const;
114  /**
115  * @brief Sets scale for anchor boxes generating
116  * @param scale Scale for anchor boxes
117  * @return reference to layer builder
118  */
119  SimplerNMSLayer& setScale(size_t scale);
120 
121  /**
122  * @brief Returns the minimum value of the proposal to be taken into consideration
123  * @return Threshold
124  */
125  float getCLSThreshold() const;
126  /**
127  * @brief Sets the minimum value of the proposal to be taken into consideration
128  * @param threshold Minimum value
129  * @return reference to layer builder
130  */
131  SimplerNMSLayer& setCLSThreshold(float threshold);
132  /**
133  * @brief Returns the minimum ratio of boxes overlapping to be taken into consideration
134  * @return Threshold
135  */
136  float getIOUThreshold() const;
137  /**
138  * @brief Sets the minimum ratio of boxes overlapping to be taken into consideration
139  * @param threshold Minimum value
140  * @return reference to layer builder
141  */
142  SimplerNMSLayer& setIOUThreshold(float threshold);
143 };
144 IE_SUPPRESS_DEPRECATED_END
145 
146 } // namespace Builder
147 } // namespace InferenceEngine
Inference Engine API.
Definition: ie_argmax_layer.hpp:11