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_PROPOSAL_H_ 18 #define MINDSPORE_CORE_OPS_PROPOSAL_H_ 19 #include <vector> 20 21 #include "ops/primitive_c.h" 22 #include "abstract/abstract_value.h" 23 #include "utils/check_convert_utils.h" 24 25 namespace mindspore { 26 namespace ops { 27 constexpr auto kNameProposal = "Proposal"; 28 class MS_CORE_API Proposal : public PrimitiveC { 29 public: Proposal()30 Proposal() : PrimitiveC(kNameProposal) {} 31 ~Proposal() = default; 32 MS_DECLARE_PARENT(Proposal, PrimitiveC); 33 34 void Init(const float feat_stride, const float base_size, const float min_size, const std::vector<float> &ratio, 35 const std::vector<float> &scale, const int64_t pre_nms_topn, const int64_t post_nms_topn, 36 const float nms_thresh); 37 void set_feat_stride(const float feat_stride); 38 void set_base_size(const float base_size); 39 void set_min_size(const float min_size); 40 void set_ratio(const std::vector<float> &ratio); 41 void set_scale(const std::vector<float> &scale); 42 void set_pre_nms_topn(const int64_t pre_nms_topn); 43 void set_post_nms_topn(const int64_t post_nms_topn); 44 void set_nms_thresh(const float nms_thresh); 45 float get_feat_stride() const; 46 float get_base_size() const; 47 float get_min_size() const; 48 std::vector<float> get_ratio() const; 49 std::vector<float> get_scale() const; 50 int64_t get_pre_nms_topn() const; 51 int64_t get_post_nms_topn() const; 52 float get_nms_thresh() const; 53 }; 54 } // namespace ops 55 } // namespace mindspore 56 57 #endif // MINDSPORE_CORE_OPS_PROPOSAL_H_ 58