@@ -568,7 +568,6 @@ def method(image):
568568 )
569569 self .log (os .path .split (instance_filepath )[1 ])
570570 return instance_labels
571- # print(self.stats_to_csv)
572571
573572 def inference_on_folder (self , inf_data , i , model , post_process_transforms ):
574573
@@ -685,14 +684,7 @@ def inference(self):
685684 # print(data)
686685 # check = data_check["image"].shape
687686 # print(check)
688- # TODO remove
689- # z_aniso = 5 / 1.5
690- # if zoom is not None :
691- # pad = utils.get_padding_dim(check, anisotropy_factor=zoom)
692- # else:
693- # self.log("\nChecking dimensions...")
694- # pad = utils.get_padding_dim(check)
695- # print(pad)
687+
696688 try :
697689 dims = self .model_dict ["segres_size" ]
698690
@@ -712,9 +704,6 @@ def inference(self):
712704
713705 model .to (self .device )
714706
715- # print("FILEPATHS PRINT")
716- # print(self.images_filepaths)
717-
718707 # load_transforms = Compose(
719708 # [
720709 # LoadImaged(keys=["image"]),
@@ -735,19 +724,10 @@ def inference(self):
735724 AsDiscrete (threshold = t ), EnsureType ()
736725 )
737726
738- # LabelFilter(applied_labels=[0]),
739727
740- # self.log("\nLoading dataset...")
741- # inference_ds = Dataset(data=images_dict, transform=load_transforms)
742- # inference_loader = DataLoader(
743- # inference_ds, batch_size=1, num_workers=2
744- # )
745- # self.log("Done")
746- # print(f"wh dir : {WEIGHTS_DIR}")
747- # print(weights)
748728 self .log (
749729 "\n Loading weights..."
750- ) # TODO add try/except for invalid weights for proper reset
730+ )
751731
752732 if self .weights_dict ["custom" ]:
753733 weights = self .weights_dict ["path" ]
@@ -789,8 +769,6 @@ def inference(self):
789769 ##################
790770 elif is_layer :
791771 input_image = self .load_layer ()
792- # print(input_image.shape)
793-
794772 else :
795773 raise ValueError ("No data has been provided. Aborting." )
796774
0 commit comments