ie_proposal_layer.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2020 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @file
7  */
8 
9 #pragma once
10 
12 #include <ie_network.hpp>
13 #include <string>
14 #include <vector>
15 
16 namespace InferenceEngine {
17 namespace Builder {
18 
19 /**
20  * @deprecated Use ngraph API instead.
21  * @brief The class represents a builder for Proposal layer
22  */
23 IE_SUPPRESS_DEPRECATED_START
24 class INFERENCE_ENGINE_NN_BUILDER_API_CLASS(ProposalLayer): public LayerDecorator {
25 public:
26  /**
27  * @brief The constructor creates a builder with the name
28  * @param name Layer name
29  */
30  explicit ProposalLayer(const std::string& name = "");
31  /**
32  * @brief The constructor creates a builder from generic builder
33  * @param layer pointer to generic builder
34  */
35  explicit ProposalLayer(const Layer::Ptr& layer);
36  /**
37  * @brief The constructor creates a builder from generic builder
38  * @param layer constant pointer to generic builder
39  */
40  explicit ProposalLayer(const Layer::CPtr& layer);
41  /**
42  * @brief Sets the name for the layer
43  * @param name Layer name
44  * @return reference to layer builder
45  */
46  ProposalLayer& setName(const std::string& name);
47 
48  /**
49  * @brief Returns output port
50  * @return Output port
51  */
52  const Port& getOutputPort() const;
53  /**
54  * @brief Sets output port
55  * @param port Output port
56  * @return reference to layer builder
57  */
58  ProposalLayer& setOutputPort(const Port& port);
59  /**
60  * @brief Returns input ports
61  * @return Vector of input ports
62  */
63  const std::vector<Port>& getInputPorts() const;
64  /**
65  * @brief Sets input ports
66  * @param ports Vector of input ports
67  * @return reference to layer builder
68  */
69  ProposalLayer& setInputPorts(const std::vector<Port>& ports);
70  /**
71  * @brief Returns the quantity of bounding boxes after applying NMS
72  * @return Quantity of bounding boxes
73  */
74  size_t getPostNMSTopN() const;
75  /**
76  * @brief Sets the quantity of bounding boxes after applying NMS
77  * @param topN Quantity of bounding boxes
78  * @return reference to layer builder
79  */
80  ProposalLayer& setPostNMSTopN(size_t topN);
81  /**
82  * @brief Returns the quantity of bounding boxes before applying NMS
83  * @return Quantity of bounding boxes
84  */
85  size_t getPreNMSTopN() const;
86  /**
87  * @brief Sets the quantity of bounding boxes before applying NMS
88  * @param topN Quantity of bounding boxes
89  * @return reference to layer builder
90  */
91  ProposalLayer& setPreNMSTopN(size_t topN);
92  /**
93  * @brief Returns minimum value of the proposal to be taken into consideration
94  * @return Threshold
95  */
96  float getNMSThresh() const;
97  /**
98  * @brief Sets minimum value of the proposal to be taken into consideration
99  * @param thresh Threshold
100  * @return reference to layer builder
101  */
102  ProposalLayer& setNMSThresh(float thresh);
103  /**
104  * @brief Returns base size for anchor generation
105  * @return Base size
106  */
107  size_t getBaseSize() const;
108  /**
109  * @brief Sets base size for anchor generation
110  * @param baseSize Base size for anchor generation
111  * @return reference to layer builder
112  */
113  ProposalLayer& setBaseSize(size_t baseSize);
114  /**
115  * @brief Returns minimum size of box to be taken into consideration
116  * @return Minimum size
117  */
118  size_t getMinSize() const;
119  /**
120  * @brief Sets minimum size of box to be taken into consideration
121  * @param minSize Minimum size of the box
122  * @return reference to layer builder
123  */
124  ProposalLayer& setMinSize(size_t minSize);
125  /**
126  * @brief Returns step size to slide over boxes in pixels
127  * @return Step size
128  */
129  size_t getFeatStride() const;
130  /**
131  * @brief Sets step size to slide over boxes in pixels
132  * @param featStride Step size
133  * @return reference to layer builder
134  */
135  ProposalLayer& setFeatStride(size_t featStride);
136  /**
137  * @brief Returns scales for anchor generation
138  * @return Vector of scales
139  */
140  const std::vector<float> getScale() const;
141  /**
142  * @brief Sets scales for anchor generation
143  * @param scales Vector of scales
144  * @return reference to layer builder
145  */
146  ProposalLayer& setScale(const std::vector<float>& scales);
147  /**
148  * @brief Returns ratios for anchor generation
149  * @return Vector of ratios
150  */
151  const std::vector<float> getRatio() const;
152  /**
153  * @brief Sets ratios for anchor generation
154  * @param ratios Vector of scales
155  * @return reference to layer builder
156  */
157  ProposalLayer& setRatio(const std::vector<float>& ratios);
158 };
159 IE_SUPPRESS_DEPRECATED_END
160 
161 } // namespace Builder
162 } // namespace InferenceEngine
Inference Engine API.
Definition: ie_argmax_layer.hpp:15
std::shared_ptr< const Layer > CPtr
A shared pointer to the constant Layer builder.
Definition: ie_layer_builder.hpp:52
std::string name
Layer name.
Definition: ie_layers.h:42
This class defines the basic functional for layer builders.
Definition: ie_layer_decorator.hpp:26
std::shared_ptr< Layer > Ptr
A shared pointer to the Layer builder.
Definition: ie_layer_builder.hpp:48
The class represents a builder for Proposal layer.
Definition: ie_proposal_layer.hpp:24
A header file for the Inference Engine Network interface.
This class is the main object to describe the Inference Engine port.
Definition: ie_network.hpp:230