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