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