@@ -272,7 +272,7 @@ def process(self, raw, identifiers, frame_meta):
272
272
self .select_output_blob (predictions )
273
273
predictions = predictions [self .output_blob ]
274
274
out_precision = frame_meta [0 ].get ('output_precision' , {})
275
- out_layout = frame_meta [0 ].get ('outpupt_layout ' , {})
275
+ out_layout = frame_meta [0 ].get ('output_layout ' , {})
276
276
if self .output_blob in out_precision and predictions .dtype != out_precision [self .output_blob ]:
277
277
predictions = predictions .view (out_precision [self .output_blob ])
278
278
if self .output_blob in out_layout and out_layout [self .output_blob ] == 'NHWC' :
@@ -367,7 +367,7 @@ def parameters(cls):
367
367
description = "Preprocesses output in the original way."
368
368
),
369
369
'output_format' : StringField (
370
- choices = ['BHW' , 'HWB' ], optional = True , default = 'BHW' ,
370
+ choices = ['BHW' , 'HWB' ], optional = True ,
371
371
description = "Set output layer format"
372
372
),
373
373
'multiple_labels' : BoolField (
@@ -456,6 +456,8 @@ def process(self, raw, identifiers, frame_meta):
456
456
detections = {'labels' : [], 'scores' : [], 'x_mins' : [], 'y_mins' : [], 'x_maxs' : [], 'y_maxs' : []}
457
457
input_shape = list (meta .get ('input_shape' , {'data' : (1 , 3 , 416 , 416 )}).values ())[0 ]
458
458
nchw_layout = input_shape [1 ] == 3
459
+ if self .output_format is None :
460
+ self .output_format = 'BHW' if nchw_layout else 'HWB'
459
461
self .processor .width_normalizer = input_shape [3 if nchw_layout else 2 ]
460
462
self .processor .height_normalizer = input_shape [2 if nchw_layout else 1 ]
461
463
for layer_id , p in enumerate (prediction ):
0 commit comments