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