@@ -54,6 +54,7 @@ def __init__(self, scale, verbose):
5454 self .scale = scale
5555
5656 def scale_input (self , input_volume , is_segmentation = False ):
57+ t0 = time .time ()
5758 if self .scale is None :
5859 return input_volume
5960
@@ -73,10 +74,11 @@ def scale_input(self, input_volume, is_segmentation=False):
7374 input_volume = rescale (input_volume , self .scale , preserve_range = True ).astype (input_volume .dtype )
7475
7576 if self .verbose :
76- print ("Rescaled volume from" , self ._original_shape , "to" , input_volume .shape )
77+ print ("Rescaled volume from" , self ._original_shape , "to" , input_volume .shape , "in" , time . time () - t0 , "s" )
7778 return input_volume
7879
7980 def rescale_output (self , output , is_segmentation ):
81+ t0 = time .time ()
8082 if self .scale is None :
8183 return output
8284
@@ -91,6 +93,9 @@ def rescale_output(self, output, is_segmentation):
9193 else :
9294 output = resize (output , out_shape , preserve_range = True ).astype (output .dtype )
9395
96+ if self .verbose :
97+ print ("Resized prediction back to original shape" , output .shape , "in" , time .time () - t0 , "s" )
98+
9499 return output
95100
96101
@@ -463,7 +468,6 @@ def get_default_tiling(is_2d: bool = False) -> Dict[str, Dict[str, int]]:
463468 tiling = {"tile" : tile , "halo" : halo }
464469 print (f"Determined tile size for MPS: { tiling } " )
465470
466-
467471 # I am not sure what is reasonable on a cpu. For now choosing very small tiling.
468472 # (This will not work well on a CPU in any case.)
469473 else :
0 commit comments