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