@@ -133,8 +133,8 @@ def load_data(imgFile, mskFile, crop_dim, n_channels, n_out_channels, openVINO_o
133
133
msks [idx ] = msk
134
134
135
135
if openVINO_order :
136
- imgs = imgs .transpose ((0 , 4 , 3 , 1 , 2 ))
137
- msks = msks .transpose ((0 , 4 , 3 , 1 , 2 ))
136
+ imgs = imgs .transpose ((0 , 4 , 1 , 2 , 3 ))
137
+ msks = msks .transpose ((0 , 4 , 1 , 2 , 3 ))
138
138
139
139
return imgs , msks , fileIDs
140
140
@@ -263,7 +263,7 @@ def main():
263
263
"""
264
264
This code checks to see if all of the graphs in the IR are
265
265
compatible with OpenVINO. If not, then you'll need to probably
266
- try to load in an extension library from ${INTEL_CVSDK_DIR }/inference_engine/lib
266
+ try to load in an extension library from ${INTEL_OPENVINO_DIR }/inference_engine/lib
267
267
"""
268
268
if "CPU" in plugin .device :
269
269
supported_layers = plugin .get_supported_layers (net )
@@ -293,11 +293,11 @@ def main():
293
293
294
294
log .info ("The network inputs are:" )
295
295
for idx , input_layer in enumerate (net .inputs .keys ()):
296
- log .info ("{}: {}, shape = {} [N,C,D, H,W]" .format (idx ,input_layer ,net .inputs [input_layer ].shape ))
296
+ log .info ("{}: {}, shape = {} [N,C,H,W,D ]" .format (idx ,input_layer ,net .inputs [input_layer ].shape ))
297
297
298
298
log .info ("The network outputs are:" )
299
299
for idx , output_layer in enumerate (net .outputs .keys ()):
300
- log .info ("{}: {}, shape = {} [N,C,D, H,W]" .format (idx ,output_layer ,net .outputs [output_layer ].shape ))
300
+ log .info ("{}: {}, shape = {} [N,C,H,W,D ]" .format (idx ,output_layer ,net .outputs [output_layer ].shape ))
301
301
302
302
303
303
batch_size , n_channels , depth , height , width = net .inputs [input_blob ].shape
@@ -415,13 +415,12 @@ def main():
415
415
ground_truth = label_data_keras [idx , :, :, :, out_channel ]
416
416
417
417
# Transpose the OpenVINO prediction back to NCHWD (to be consistent with Keras)
418
- pred_ov = np .transpose (predictions_ov , [0 ,3 ,4 , 2 ,1 ])[idx , :, :, :, out_channel ]
418
+ pred_ov = np .transpose (predictions_ov , [0 ,2 , 3 ,4 ,1 ])[idx , :, :, :, out_channel ]
419
419
pred_keras = predictions_keras [idx , :, :, :, out_channel ]
420
420
421
421
dice_ov = dice_score (pred_ov , ground_truth )
422
422
dice_keras = dice_score (pred_keras , ground_truth )
423
423
424
- dice_compare = dice_score (pred_ov , pred_keras )
425
424
426
425
# img = nib.Nifti1Image(imgs[idx, :, :, :, 0], np.eye(4))
427
426
# img.to_filename(os.path.join(save_directory,
@@ -436,8 +435,8 @@ def main():
436
435
# "{}_pred_ov.nii.gz".format(fileIDs[idx])))
437
436
438
437
log .info ("Image file {}: OpenVINO Dice score = {:f}, "
439
- "Keras/TF Dice score = {:f}, Comparing Dice Score = {:f }" .format (
440
- img_indicies [idx ], dice_ov , dice_keras , dice_compare ))
438
+ "Keras/TF Dice score = {:f}, Maximum absolute pixel difference OV versus Keras/TF = {:.2e }" .format (
439
+ img_indicies [idx ], dice_ov , dice_keras , np . mean ( np . abs ( pred_ov - pred_keras )) ))
441
440
442
441
log .info ("Average inference time: \n "
443
442
"OpenVINO = {} seconds (s.d. {})\n "
0 commit comments