@@ -104,11 +104,9 @@ def __init__(self, config_entry, model_name='', delayed_model_loading=False,
104
104
self ._num_requests = None
105
105
106
106
if not delayed_model_loading :
107
- self ._model , self ._weights = automatic_model_search (
108
- self ._model_name , self .get_value_from_config ('model' ),
109
- self .get_value_from_config ('weights' ),
110
- self .get_value_from_config ('_model_type' )
111
- )
107
+ self ._model , self ._weights = automatic_model_search (self ._model_name , self .get_value_from_config ('model' ),
108
+ self .get_value_from_config ('weights' ),
109
+ self .get_value_from_config ('_model_type' ))
112
110
self .load_network (log = not postpone_inputs_configuration , preprocessing = preprocessor )
113
111
self .allow_reshape_input = self .get_value_from_config ('allow_reshape_input' ) and self .network is not None
114
112
if not postpone_inputs_configuration :
@@ -153,10 +151,7 @@ def device(self):
153
151
154
152
@property
155
153
def inputs (self ):
156
- if self .network is None :
157
- inputs = self .exec_network .inputs
158
- else :
159
- inputs = self .network .inputs
154
+ inputs = self .exec_network .inputs if self .network is None else self .network .inputs
160
155
return {input_info .get_node ().friendly_name : input_info .get_node () for input_info in inputs }
161
156
162
157
@property
@@ -835,7 +830,9 @@ def _data_to_blob(self, layer_shape, data, layout): # pylint:disable=R0911,R091
835
830
if len (np .squeeze (np .zeros (layer_shape ))) == len (np .squeeze (np .zeros (data_shape ))):
836
831
return np .resize (data , layer_shape )
837
832
if len (layer_shape ) == 3 and len (data_shape ) == 4 :
838
- return np .transpose (data , layout )[0 ] if layout is not None else data [0 ]
833
+ if layout is not None :
834
+ return np .transpose (data [0 ], layout ) if len (layout ) == 3 else np .transpose (data , layout )[0 ]
835
+ return data [0 ]
839
836
if len (layer_shape ) == 1 :
840
837
return np .resize (data , layer_shape )
841
838
if (len (data_shape ) == 3 ) and (len (layer_shape ) == 2 ) and (data_shape [0 ] == 1 ) and (
0 commit comments