experimental_detectron_topkrois.hpp
1 //*****************************************************************************
2 // Copyright 2017-2021 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //*****************************************************************************
16 
17 #pragma once
18 
19 #include <cstdint>
20 #include <vector>
21 #include "ngraph/attribute_adapter.hpp"
22 #include "ngraph/op/op.hpp"
23 #include "ngraph/op/util/attr_types.hpp"
24 
25 namespace ngraph
26 {
27  namespace op
28  {
29  namespace v6
30  {
31  /// \brief An operation ExperimentalDetectronTopKROIs, according to the repository
32  /// https://github.com/openvinotoolkit/training_extensions (see
33  /// pytorch_toolkit/instance_segmentation/segmentoly/rcnn/roi_feature_extractor.py).
34  class NGRAPH_API ExperimentalDetectronTopKROIs : public Op
35  {
36  public:
37  NGRAPH_RTTI_DECLARATION;
38 
40  /// \brief Constructs a ExperimentalDetectronTopKROIs operation.
41  ///
42  /// \param input_rois Input rois
43  /// \param rois_probs Probabilities for input rois
44  /// \param max_rois Maximal numbers of output rois
46  const Output<Node>& rois_probs,
47  size_t max_rois = 0);
48 
49  void validate_and_infer_types() override;
50  bool visit_attributes(AttributeVisitor& visitor) override;
51 
52  std::shared_ptr<Node>
53  clone_with_new_inputs(const OutputVector& new_args) const override;
54 
55  size_t get_max_rois() const { return m_max_rois; }
56  private:
57  size_t m_max_rois;
58  };
59  }
60  }
61 }
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:71
A handle for one of a node's outputs.
Definition: node_output.hpp:42
Root of all actual ops.
Definition: op.hpp:29
An operation ExperimentalDetectronTopKROIs, according to the repository https://github....
Definition: experimental_detectron_topkrois.hpp:35
ExperimentalDetectronTopKROIs(const Output< Node > &input_rois, const Output< Node > &rois_probs, size_t max_rois=0)
Constructs a ExperimentalDetectronTopKROIs operation.
void validate_and_infer_types() override
Verifies that attributes and inputs are consistent and computes output shapes and element types....
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28