1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
7 #include <builders/ie_layer_decorator.hpp>
8 #include <ie_network.hpp>
12 namespace InferenceEngine {
16 * @brief The class represents a builder for Proposal layer
18 class INFERENCE_ENGINE_API_CLASS(ProposalLayer): public LayerDecorator {
21 * @brief The constructor creates a builder with the name
22 * @param name Layer name
24 explicit ProposalLayer(const std::string& name = "");
26 * @brief The constructor creates a builder from generic builder
27 * @param layer pointer to generic builder
29 explicit ProposalLayer(const Layer::Ptr& layer);
31 * @brief The constructor creates a builder from generic builder
32 * @param layer constant pointer to generic builder
34 explicit ProposalLayer(const Layer::CPtr& layer);
36 * @brief Sets the name for the layer
37 * @param name Layer name
38 * @return reference to layer builder
40 ProposalLayer& setName(const std::string& name);
43 * @brief Returns output port
46 const Port& getOutputPort() const;
48 * @brief Sets output port
49 * @param port Output port
50 * @return reference to layer builder
52 ProposalLayer& setOutputPort(const Port& port);
54 * @brief Returns input ports
55 * @return Vector of input ports
57 const std::vector<Port>& getInputPorts() const;
59 * @brief Sets input ports
60 * @param ports Vector of input ports
61 * @return reference to layer builder
63 ProposalLayer& setInputPorts(const std::vector<Port>& ports);
65 * @brief Returns the quantity of bounding boxes after applying NMS
66 * @return Quantity of bounding boxes
68 size_t getPostNMSTopN() const;
70 * @brief Sets the quantity of bounding boxes after applying NMS
71 * @param topN Quantity of bounding boxes
72 * @return reference to layer builder
74 ProposalLayer& setPostNMSTopN(size_t topN);
76 * @brief Returns the quantity of bounding boxes before applying NMS
77 * @return Quantity of bounding boxes
79 size_t getPreNMSTopN() const;
81 * @brief Sets the quantity of bounding boxes before applying NMS
82 * @param topN Quantity of bounding boxes
83 * @return reference to layer builder
85 ProposalLayer& setPreNMSTopN(size_t topN);
87 * @brief Returns minimum value of the proposal to be taken into consideration
90 float getNMSThresh() const;
92 * @brief Sets minimum value of the proposal to be taken into consideration
93 * @param thresh Threshold
94 * @return reference to layer builder
96 ProposalLayer& setNMSThresh(float thresh);
98 * @brief Returns base size for anchor generation
101 size_t getBaseSize() const;
103 * @brief Sets base size for anchor generation
104 * @param baseSize Base size for anchor generation
105 * @return reference to layer builder
107 ProposalLayer& setBaseSize(size_t baseSize);
109 * @brief Returns minimum size of box to be taken into consideration
110 * @return Minimum size
112 size_t getMinSize() const;
114 * @brief Sets minimum size of box to be taken into consideration
115 * @param minSize Minimum size of the box
116 * @return reference to layer builder
118 ProposalLayer& setMinSize(size_t minSize);
120 * @brief Returns step size to slide over boxes in pixels
123 size_t getFeatStride() const;
125 * @brief Sets step size to slide over boxes in pixels
126 * @param featStride Step size
127 * @return reference to layer builder
129 ProposalLayer& setFeatStride(size_t featStride);
131 * @brief Returns scales for anchor generation
132 * @return Vector of scales
134 const std::vector<float> getScale() const;
136 * @brief Sets scales for anchor generation
137 * @param scales Vector of scales
138 * @return reference to layer builder
140 ProposalLayer& setScale(const std::vector<float>& scales);
142 * @brief Returns ratios for anchor generation
143 * @return Vector of ratios
145 const std::vector<float> getRatio() const;
147 * @brief Sets ratios for anchor generation
148 * @param ratios Vector of scales
149 * @return reference to layer builder
151 ProposalLayer& setRatio(const std::vector<float>& ratios);
154 } // namespace Builder
155 } // namespace InferenceEngine