2 Copyright (c) 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.
19 from mo.ops.op import Op
22 class ExperimentalDetectronROIFeatureExtractor(Op):
23 op = 'ExperimentalDetectronROIFeatureExtractor'
25 def __init__(self, graph, attrs):
26 mandatory_props = dict(
32 super().__init__(graph, mandatory_props, attrs)
34 def backend_attrs(self):
36 'distribute_rois_between_levels',
37 ('pyramid_scales', lambda node: ','.join(map(str, node['pyramid_scales']))),
41 'preserve_rois_order']
45 input_rois_shape = node.in_node(0).shape
46 rois_num = input_rois_shape[0]
47 input_features_level_0_shape = node.in_node(1).shape
48 channels_num = input_features_level_0_shape[1]
49 node.out_node(0).shape = np.array([rois_num, channels_num, node.output_size, node.output_size], dtype=np.int64)
51 node.out_node(1).shape = np.array([rois_num, 4], dtype=np.int64)
52 except Exception as ex: