• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright 2020 Huawei Technologies Co., Ltd
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 #ifndef MINDSPORE_CORE_OPS_NON_MAX_SUPPRESSION_H_
18 #define MINDSPORE_CORE_OPS_NON_MAX_SUPPRESSION_H_
19 
20 #include <algorithm>
21 #include <map>
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 #include "mindapi/base/types.h"
27 #include "ops/base_operator.h"
28 
29 namespace mindspore {
30 namespace ops {
31 constexpr auto kNameNonMaxSuppression = "NonMaxSuppression";
32 /// \brief NonMaxSuppression QuantDTypeCast the NonMaxSuppression operator prototype.
33 class MIND_API NonMaxSuppression : public BaseOperator {
34  public:
35   MIND_API_BASE_MEMBER(NonMaxSuppression);
36   /// \brief Constructor.
NonMaxSuppression()37   NonMaxSuppression() : BaseOperator(kNameNonMaxSuppression) {}
38 
39   /// \brief Method to init the op's attributes.
40   ///
41   /// \param[in] center_point_box Define a value to indicate the format of the box data. If the value is 0, the box data
42   ///            is supplied by diagonal point, such as [y1, x1, y2, x2](the pair [y1, x1] is picture coordinate). If
43   ///            the value is 1, the box data is supplied as [x_center, y_center, width, height].
44   void Init(const int64_t center_point_box = 0);
45 
46   /// \brief Method to set center_point_box attribute.
47   ///
48   /// \param[in] center_point_box a value to indicate the format of the box data.
49   void set_center_point_box(const int64_t center_point_box);
50 
51   /// \brief Method to get center_point_box attribute.
52   ///
53   /// \return an integer value.
54   int64_t get_center_point_box() const;
55 };
56 MIND_API abstract::AbstractBasePtr NonMaxSuppressionInfer(const abstract::AnalysisEnginePtr &,
57                                                           const PrimitivePtr &primitive,
58                                                           const std::vector<abstract::AbstractBasePtr> &input_args);
59 using PrimNonMaxSuppressionPtr = std::shared_ptr<NonMaxSuppression>;
60 }  // namespace ops
61 }  // namespace mindspore
62 
63 #endif  // MINDSPORE_CORE_OPS_NON_MAX_SUPPRESSION_H_
64