@@ -245,7 +245,6 @@ def read_image(test_data_path, data_name, sizes=(128, 128, 128), is_series=True,
245
245
def main ():
246
246
args = parse_arguments ()
247
247
248
- # --------------------------------- 1. Load Plugin for inference engine ---------------------------------
249
248
log .info ('OpenVINO Inference Engine' )
250
249
log .info ('\t build: {}' .format (get_version ()))
251
250
core = Core ()
@@ -262,7 +261,6 @@ def main():
262
261
raise AttributeError ("Device {} do not support of 3D convolution. "
263
262
"Please use CPU, GPU or HETERO:*CPU*, HETERO:*GPU*" )
264
263
265
- # --------------------- 2. Read IR Generated by ModelOptimizer (.xml file) ---------------------
266
264
log .info ('Reading model {}' .format (args .path_to_model ))
267
265
model = core .read_model (args .path_to_model )
268
266
@@ -279,12 +277,10 @@ def main():
279
277
280
278
n , c , d , h , w = model .inputs [0 ].shape
281
279
282
- # ------------------------------------ 3. Loading model to the plugin -------------------------------------
283
280
compiled_model = core .compile_model (model , args .target_device )
284
281
infer_request = compiled_model .create_infer_request ()
285
282
log .info ('The model {} is loaded to {}' .format (args .path_to_model , args .target_device ))
286
283
287
- # --------------------------------------- 4. Preparing input data -----------------------------------------
288
284
start_time = perf_counter ()
289
285
if not os .path .exists (args .path_to_input_data ):
290
286
raise AttributeError ("Path to input data: '{}' does not exist" .format (args .path_to_input_data ))
@@ -312,9 +308,7 @@ def main():
312
308
original_data = data_crop
313
309
original_size = original_data .shape [- 3 :]
314
310
315
- # ---------------------------------------------- 5. Do inference --------------------------------------------
316
311
result = infer_request .infer ({input_tensor_name : data_crop })
317
- # ---------------------------- 6. Processing of the received inference results ------------------------------
318
312
result = next (iter (result .values ()))
319
313
batch , channels , out_d , out_h , out_w = result .shape
320
314
@@ -375,7 +369,6 @@ def main():
375
369
total_latency = (perf_counter () - start_time ) * 1e3
376
370
log .info ("Metrics report:" )
377
371
log .info ("\t Latency: {:.1f} ms" .format (total_latency ))
378
- # --------------------------------------------- 7. Save output -----------------------------------------------
379
372
tiff_output_name = os .path .join (args .path_to_output , 'output.tiff' )
380
373
Image .new ('RGB' , (original_data .shape [3 ], original_data .shape [2 ])).save (tiff_output_name ,
381
374
append_images = list_img , save_all = True )
0 commit comments