summaryrefslogtreecommitdiff
path: root/inference-engine/include/builders/ie_proposal_layer.hpp
blob: e7fcac461eae64769d4ce7dfa35c997c1631e8d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// Copyright (C) 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#pragma once

#include <builders/ie_layer_fragment.hpp>
#include <ie_inetwork.hpp>
#include <string>
#include <vector>

namespace InferenceEngine {
namespace Builder {

/**
 * @brief The class represents a builder for Proposal layer
 */
class INFERENCE_ENGINE_API_CLASS(ProposalLayer): public LayerFragment {
public:
    /**
     * @brief The constructor creates a builder with the name
     * @param name Layer name
     */
    explicit ProposalLayer(const std::string& name = "");
    /**
     * @brief The constructor creates a builder from generic builder
     * @param genLayer generic builder
     */
    explicit ProposalLayer(Layer& genLayer);
    /**
     * @brief Sets the name for the layer
     * @param name Layer name
     * @return reference to layer builder
     */
    ProposalLayer& setName(const std::string& name);

    /**
     * @brief Returns output port
     * @return Output port
     */
    const Port& getOutputPort() const;
    /**
     * @brief Sets output port
     * @param port Output port
     * @return reference to layer builder
     */
    ProposalLayer& setOutputPort(const Port& port);
    /**
     * @brief Returns input ports
     * @return Vector of input ports
     */
    const std::vector<Port>& getInputPorts() const;
    /**
     * @brief Sets input ports
     * @param ports Vector of input ports
     * @return reference to layer builder
     */
    ProposalLayer& setInputPorts(const std::vector<Port>& ports);
    /**
     * @brief Returns the quantity of bounding boxes after applying NMS
     * @return Quantity of bounding boxes
     */
    size_t getPostNMSTopN() const;
    /**
     * @brief Sets the quantity of bounding boxes after applying NMS
     * @param topN Quantity of bounding boxes
     * @return reference to layer builder
     */
    ProposalLayer& setPostNMSTopN(size_t topN);
    /**
     * @brief Returns the quantity of bounding boxes before applying NMS
     * @return Quantity of bounding boxes
     */
    size_t getPreNMSTopN() const;
    /**
     * @brief Sets the quantity of bounding boxes before applying NMS
     * @param topN Quantity of bounding boxes
     * @return reference to layer builder
     */
    ProposalLayer& setPreNMSTopN(size_t topN);
    /**
     * @brief Returns minimum value of the proposal to be taken into consideration
     * @return Threshold
     */
    float getNMSThresh() const;
    /**
     * @brief Sets minimum value of the proposal to be taken into consideration
     * @param thresh Threshold
     * @return reference to layer builder
     */
    ProposalLayer& setNMSThresh(float thresh);
    /**
     * @brief Returns base size for anchor generation
     * @return Base size
     */
    size_t getBaseSize() const;
    /**
     * @brief Sets base size for anchor generation
     * @param baseSize Base size for anchor generation
     * @return reference to layer builder
     */
    ProposalLayer& setBaseSize(size_t baseSize);
    /**
     * @brief Returns minimum size of box to be taken into consideration
     * @return Minimum size
     */
    size_t getMinSize() const;
    /**
     * @brief Sets minimum size of box to be taken into consideration
     * @param minSize Minimum size of the box
     * @return reference to layer builder
     */
    ProposalLayer& setMinSize(size_t minSize);
    /**
     * @brief Returns step size to slide over boxes in pixels
     * @return Step size
     */
    size_t getFeatStride() const;
    /**
     * @brief Sets step size to slide over boxes in pixels
     * @param featStride Step size
     * @return reference to layer builder
     */
    ProposalLayer& setFeatStride(size_t featStride);
    /**
     * @brief Returns scales for anchor generation
     * @return Vector of scales
     */
    const std::vector<float> getScale() const;
    /**
     * @brief Sets scales for anchor generation
     * @param scales Vector of scales
     * @return reference to layer builder
     */
    ProposalLayer& setScale(const std::vector<float>& scales);
    /**
     * @brief Returns ratios for anchor generation
     * @return Vector of ratios
     */
    const std::vector<float> getRatio() const;
    /**
     * @brief Sets ratios for anchor generation
     * @param ratios Vector of scales
     * @return reference to layer builder
     */
    ProposalLayer& setRatio(const std::vector<float>& ratios);
};

}  // namespace Builder
}  // namespace InferenceEngine