ie_simpler_nms_layer.hpp
1 // Copyright (C) 2018 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include <builders/ie_layer_fragment.hpp>
8 #include <ie_inetwork.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 LayerFragment {
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 genLayer generic builder
28  */
29  explicit SimplerNMSLayer(Layer& genLayer);
30  /**
31  * @brief Sets the name for the layer
32  * @param name Layer name
33  * @return reference to layer builder
34  */
35  SimplerNMSLayer& setName(const std::string& name);
36 
37  /**
38  * @brief Returns input ports
39  * @return Vector of input ports
40  */
41  const std::vector<Port>& getInputPorts() const;
42  /**
43  * @brief Sets input ports
44  * @param ports Vector of input ports
45  */
46  SimplerNMSLayer& setInputPorts(const std::vector<Port>& ports);
47  /**
48  * @brief Returns output port
49  * @return Output port
50  */
51  const Port& getOutputPort() const;
52  /**
53  * @brief Sets output port
54  * @param port Output port
55  * @return reference to layer builder
56  */
57  SimplerNMSLayer& setOutputPort(const Port& port);
58  /**
59  * @brief Returns the quantity of bounding boxes before applying NMS
60  * @return Quantity of bounding boxes
61  */
62  size_t getPreNMSTopN() const;
63  /**
64  * @brief Sets the quantity of bounding boxes before applying NMS
65  * @param topN Quantity of bounding boxes
66  * @return reference to layer builder
67  */
68  SimplerNMSLayer& setPreNMSTopN(size_t topN);
69  /**
70  * @brief Returns the quantity of bounding boxes after applying NMS
71  * @return Quantity of bounding boxes
72  */
73  size_t getPostNMSTopN() const;
74  /**
75  * @brief Sets the quantity of bounding boxes after applying NMS
76  * @param topN Quantity of bounding boxes
77  * @return reference to layer builder
78  */
79  SimplerNMSLayer& setPostNMSTopN(size_t topN);
80  /**
81  * @brief Returns the step size to slide over boxes in pixels
82  * @return Step size
83  */
84  size_t getFeatStride() const;
85  /**
86  * @brief Sets the step size to slide over boxes in pixels
87  * @param featStride Step size
88  * @return reference to layer builder
89  */
90  SimplerNMSLayer& setFeatStride(size_t featStride);
91  /**
92  * @brief Returns the minimum size of box to be taken into consideration
93  * @return Minimum size
94  */
95  size_t getMinBoxSize() const;
96  /**
97  * @brief Sets the minimum size of box to be taken into consideration
98  * @param minSize Minimum size
99  * @return reference to layer builder
100  */
101  SimplerNMSLayer& setMinBoxSize(size_t minSize);
102  /**
103  * @brief Returns scale for anchor boxes generating
104  * @return Scale for anchor boxes
105  */
106  size_t getScale() const;
107  /**
108  * @brief Sets scale for anchor boxes generating
109  * @param scale Scale for anchor boxes
110  * @return reference to layer builder
111  */
112  SimplerNMSLayer& setScale(size_t scale);
113 
114  /**
115  * @brief Returns the minimum value of the proposal to be taken into consideration
116  * @return Threshold
117  */
118  float getCLSThreshold() const;
119  /**
120  * @brief Sets the minimum value of the proposal to be taken into consideration
121  * @param threshold Minimum value
122  * @return reference to layer builder
123  */
124  SimplerNMSLayer& setCLSThreshold(float threshold);
125  /**
126  * @brief Returns the minimum ratio of boxes overlapping to be taken into consideration
127  * @return Threshold
128  */
129  float getIOUThreshold() const;
130  /**
131  * @brief Sets the minimum ratio of boxes overlapping to be taken into consideration
132  * @param threshold Minimum value
133  * @return reference to layer builder
134  */
135  SimplerNMSLayer& setIOUThreshold(float threshold);
136 };
137 
138 } // namespace Builder
139 } // namespace InferenceEngine
140 
Definition: ie_argmax_layer.hpp:11
a header file for the Inference Engine Network interface