def saveParameters(self): """ Saves the parameters as tiktorch Object """ self.code_path = str(self.code_path_textbox.text()) self.model_class_name = str(self.model_class_name_textbox.text()) self.state_path = str(self.state_path_textbox.text()) self.input_shape = [ int(x) for x in self.input_shape_textbox.text()[1:-1].replace( ", ", ",").split(",") ] self.minimal_increment = [ int(x) for x in self.minimal_increment_textbox.text()[1:-1].replace( ", ", ",").split(",") ] self.model_init_kwargs = yaml.load( str(self.model_init_kwargs_textbox.text())[1:-1].replace( ", ", "\n")) self.model_path = str(self.model_path_textbox.text()) spec = TikTorchSpec( code_path=self.code_path, model_class_name=self.model_class_name, state_path=self.state_path, input_shape=self.input_shape, minimal_increment=self.minimal_increment, model_init_kwargs=self.model_init_kwargs, ) buildface = BuildSpec(self.model_path) buildface.build(spec)
def test_BuildUNet2d(self): spec = TikTorchSpec(code_path='/home/jo/sfb1129/pretrained_net_constantin/ISBI2012_UNet_pretrained/model.py', model_class_name='UNet2dGN', state_path='/home/jo/sfb1129/pretrained_net_constantin/ISBI2012_UNet_pretrained/state.nn', input_shape=(1, 572, 572), minimal_increment=[32, 32], model_init_kwargs={'in_channels': 1, 'out_channels': 1, 'initial_features': 64}) self.spec.validate() build_spec = BuildSpec(build_directory='/home/jo/ISBI_UNet_pretrained', device='cpu') build_spec.build(self.spec)
def test_BuilDUNet3d(self): spec = TikTorchSpec(code_path='/home/jo/uni/master-models/master_models/models/dunet3D.py', model_class_name='DUNet3D', state_path='/home/jo/uni/master-models/master_models/results/dunet3D/trained_net/best_model_dunet3D.torch', input_shape=[1, 512, 512], minimal_increment=[32, 32], model_init_kwargs={'in_channels': 1, 'out_channels': 1}) self.spec.validate() build_spec = BuildSpec(build_directory='/home/jo/CREMI_DUNet_pretrained', device='cpu') build_spec.build(self.spec)
def test_BuildDUNet2d(self): spec = TikTorchSpec(code_path='/home/jo/config/model.py', model_class_name='DUNet2D', state_path='/home/jo/config/state.nn', input_shape=[1, 512, 512], minimal_increment=[32, 32], model_init_kwargs={'in_channels': 1, 'out_channels': 1}) self.spec.validate() build_spec = BuildSpec(build_directory='/home/jo/CREMI_DUNet_pretrained', device='cpu') build_spec.build(self.spec)
def test_BuildDUNet2d(self): spec = TikTorchSpec( code_path="/home/jo/config/model.py", model_class_name="DUNet2D", state_path="/home/jo/config/state.nn", input_shape=[1, 512, 512], minimal_increment=[32, 32], model_init_kwargs={ "in_channels": 1, "out_channels": 1 }, ) self.spec.validate() build_spec = BuildSpec( build_directory="/home/jo/CREMI_DUNet_pretrained", device="cpu") build_spec.build(self.spec)
def test_BuilDUNet3d(self): spec = TikTorchSpec( code_path= "/home/jo/uni/master-models/master_models/models/dunet3D.py", model_class_name="DUNet3D", state_path= "/home/jo/uni/master-models/master_models/results/dunet3D/trained_net/best_model_dunet3D.torch", input_shape=[1, 512, 512], minimal_increment=[32, 32], model_init_kwargs={ "in_channels": 1, "out_channels": 1 }, ) self.spec.validate() build_spec = BuildSpec( build_directory="/home/jo/CREMI_DUNet_pretrained", device="cpu") build_spec.build(self.spec)
def test_BuildUNet2d(self): spec = TikTorchSpec( code_path= "/home/jo/sfb1129/pretrained_net_constantin/ISBI2012_UNet_pretrained/model.py", model_class_name="UNet2dGN", state_path= "/home/jo/sfb1129/pretrained_net_constantin/ISBI2012_UNet_pretrained/state.nn", input_shape=(1, 572, 572), minimal_increment=[32, 32], model_init_kwargs={ "in_channels": 1, "out_channels": 1, "initial_features": 64 }, ) self.spec.validate() build_spec = BuildSpec(build_directory="/home/jo/ISBI_UNet_pretrained", device="cpu") build_spec.build(self.spec)