2 Copyright (c) 2018-2019 Intel Corporation
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
8 http://www.apache.org/licenses/LICENSE-2.0
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.
18 from mo.front.extractor import CaffePythonFrontExtractorOp
19 from mo.ops.op import Op
20 from mo.utils.error import Error
23 class ProposalPythonFrontExtractor(CaffePythonFrontExtractorOp):
24 op = 'rpn.proposal_layer.ProposalLayer'
29 param = node.pb.python_param
30 attrs = CaffePythonFrontExtractorOp.parse_param_str(param.param_str)
41 if 'ratios' in attrs and 'ratio' in attrs :
42 log.error('Both ratios and ratio found, value of ratios will be used', extra={'is_warning':True})
43 if 'scales' in attrs and 'scale' in attrs :
44 log.error('Both scales and scale found, value of scales will be used', extra={'is_warning':True})
47 attrs['ratio']=attrs['ratios']
50 attrs['scale']=attrs['scales']
53 update_attrs.update(attrs)
54 CaffePythonFrontExtractorOp.check_param(Op.get_op_class_by_name('Proposal'), update_attrs)
55 Op.get_op_class_by_name('Proposal').update_node_stat(node, update_attrs)
56 return __class__.enabled