experimental_detectron_generate_proposals.hpp
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 #pragma once
6 
7 #include <cstdint>
8 #include <vector>
9 #include "ngraph/attribute_adapter.hpp"
10 #include "ngraph/op/op.hpp"
11 #include "ngraph/op/util/attr_types.hpp"
12 
13 namespace ngraph
14 {
15  namespace op
16  {
17  namespace v6
18  {
19  /// \brief An operation ExperimentalDetectronGenerateProposalsSingleImage
20  /// computes ROIs and their scores based on input data.
22  {
23  public:
24  NGRAPH_RTTI_DECLARATION;
25 
26  /// \brief Structure that specifies attributes of the operation
27  struct Attributes
28  {
29  // minimum box width & height
30  float min_size;
31  // specifies NMS threshold
32  float nms_threshold;
33  // number of top-n proposals after NMS
34  int64_t post_nms_count;
35  // number of top-n proposals before NMS
36  int64_t pre_nms_count;
37  };
38 
40  /// \brief Constructs a ExperimentalDetectronGenerateProposalsSingleImage operation.
41  ///
42  /// \param im_info Input image info
43  /// \param anchors Input anchors
44  /// \param deltas Input deltas
45  /// \param scores Input scores
46  /// \param attrs Operation attributes
48  const Output<Node>& anchors,
49  const Output<Node>& deltas,
50  const Output<Node>& scores,
51  const Attributes& attrs);
52 
53  bool visit_attributes(AttributeVisitor& visitor) override;
54 
55  void validate_and_infer_types() override;
56 
57  std::shared_ptr<Node>
58  clone_with_new_inputs(const OutputVector& new_args) const override;
59 
60  const Attributes& get_attrs() const { return m_attrs; }
61 
62  private:
63  Attributes m_attrs;
64  };
65  } // namespace v6
66  } // namespace op
67 } // namespace ngraph
Visits the attributes of a node, primarily for serialization-like tasks.
Definition: attribute_visitor.hpp:59
A handle for one of a node's outputs.
Definition: node_output.hpp:33
Root of all actual ops.
Definition: op.hpp:17
An operation ExperimentalDetectronGenerateProposalsSingleImage computes ROIs and their scores based o...
Definition: experimental_detectron_generate_proposals.hpp:22
ExperimentalDetectronGenerateProposalsSingleImage(const Output< Node > &im_info, const Output< Node > &anchors, const Output< Node > &deltas, const Output< Node > &scores, const Attributes &attrs)
Constructs a ExperimentalDetectronGenerateProposalsSingleImage 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:16
Structure that specifies attributes of the operation.
Definition: experimental_detectron_generate_proposals.hpp:28