33from pathlib import Path
44import importlib .util
55from typing import Optional
6- import warnings
76
87import numpy as np
98from tifffile import imwrite
@@ -112,7 +111,7 @@ def show_progress(count, block_size, total_size):
112111 pretrained_folder_path , model_weights_filename
113112 )
114113 if os .path .exists (check_path ):
115- message = f"Weight file { model_weights_filename } already exists, skipping download step "
114+ message = f"Weight file { model_weights_filename } already exists, skipping download"
116115 if self .log_widget is not None :
117116 self .log_widget .print_and_log (message , printing = False )
118117 print (message )
@@ -240,7 +239,6 @@ def __init__(
240239 self .layer = layer
241240 self .images_filepaths = images_filepaths
242241
243-
244242 """These attributes are all arguments of :py:func:~inference, please see that for reference"""
245243
246244 self .downloader = WeightsDownloader ()
@@ -362,8 +360,8 @@ def load_layer(self):
362360 dims_check = volume .shape
363361 self .log ("\n Checking dimensions..." )
364362 pad = utils .get_padding_dim (dims_check )
365- print (volume .shape )
366- print (volume .dtype )
363+ # print(volume.shape)
364+ # print(volume.dtype)
367365 load_transforms = Compose (
368366 [
369367 ToTensor (),
@@ -534,10 +532,14 @@ def inference_on_list(self, inf_data, i, model, post_process_transforms):
534532
535533 def stats_csv (self , instance_labels ):
536534 if self .stats_to_csv :
535+ # try:
537536 data_dict = volume_stats (
538537 instance_labels
539538 ) # TODO test with area mesh function
540539 return data_dict
540+ # except ValueError as e:
541+ # self.log(f"Error occurred during stats computing : {e}")
542+ # return None
541543 else :
542544 return None
543545
@@ -677,7 +679,6 @@ def inference(self):
677679 if self .model_dict ["name" ] == "SegResNet" :
678680 model = self .model_dict ["class" ].get_net ()(
679681 input_image_size = [
680-
681682 dims ,
682683 dims ,
683684 dims ,
@@ -751,7 +752,7 @@ def inference(self):
751752
752753 if is_layer and is_folder :
753754 raise ValueError (
754- "Both a layer and a folder have been specified, please specifiy only one of the two. Aborting."
755+ "Both a layer and a folder have been specified, please specify only one of the two. Aborting."
755756 )
756757 elif is_folder :
757758 inference_loader = self .load_folder ()
@@ -767,7 +768,7 @@ def inference(self):
767768 ##################
768769 elif is_layer :
769770 input_image = self .load_layer ()
770- print (input_image .shape )
771+ # print(input_image.shape)
771772
772773 else :
773774 raise ValueError ("No data has been provided. Aborting." )
0 commit comments