Skip to content
Snippets Groups Projects
Commit ca352f26 authored by s.islam's avatar s.islam
Browse files

Adding image grid in validation loop: To illustrate and compare pli, cyto, and...

Adding image grid in validation loop: To illustrate and compare pli, cyto, and generated cyto:With Chanel(nos.) correction
parent f0fbf791
No related branches found
No related tags found
No related merge requests found
...@@ -122,12 +122,12 @@ class TestDataModule(pl.LightningDataModule): ...@@ -122,12 +122,12 @@ class TestDataModule(pl.LightningDataModule):
# Load the pyramid/00 per file # Load the pyramid/00 per file
#For JSC Training. #For JSC Training.
pli_path = '/p/fastdata/pli/Private/oberstrass1/datasets/vervet1818/vervet1818-stained/data/aligned/pli/NTransmittance' #pli_path = '/p/fastdata/pli/Private/oberstrass1/datasets/vervet1818/vervet1818-stained/data/aligned/pli/NTransmittance'
cyto_path = '/p/fastdata/pli/Private/oberstrass1/datasets/vervet1818/vervet1818-stained/data/aligned/stained' #cyto_path = '/p/fastdata/pli/Private/oberstrass1/datasets/vervet1818/vervet1818-stained/data/aligned/stained'
#For Local Machine Training. #For Local Machine Training.
#pli_path = '/media/tushar/A2246889246861F1/Master Thesis MAIA/example-data/pli/NTransmittance' pli_path = '/media/tushar/A2246889246861F1/Master Thesis MAIA/example-data/pli/NTransmittance'
#cyto_path = '/media/tushar/A2246889246861F1/Master Thesis MAIA/example-data/stained' cyto_path = '/media/tushar/A2246889246861F1/Master Thesis MAIA/example-data/stained'
pli_files_list = [file for file in os.listdir(pli_path) if pli_files_list = [file for file in os.listdir(pli_path) if
file.endswith(('.h5', '.hdf', '.h4', '.hdf4', '.he2', '.hdf5', '.he5'))] file.endswith(('.h5', '.hdf', '.h4', '.hdf4', '.he2', '.hdf5', '.he5'))]
......
...@@ -53,8 +53,8 @@ class TestModule(pl.LightningModule): ...@@ -53,8 +53,8 @@ class TestModule(pl.LightningModule):
loss = self.loss_f(cyto_imag_generated, batch['cyto_image']) loss = self.loss_f(cyto_imag_generated, batch['cyto_image'])
self.log("val_loss", loss) self.log("val_loss", loss)
if batch_idx == 0: if batch_idx == 0:
grid = make_grid([batch['pli_image'][0, 0], batch['cyto_image'][0, 0], cyto_imag_generated[0, 0]]) grid = make_grid([batch['pli_image'][0], batch['cyto_image'][0], cyto_imag_generated[0]])
self.logger.experiment.add_image('Grid_images', grid, self.current_epoch, dataformats="HW") self.logger.experiment.add_image('Grid_images', grid, self.current_epoch, dataformats="CHW")
def configure_optimizers(self): def configure_optimizers(self):
optimizer = torch.optim.Adam(self.parameters(), lr=self.learning_rate) optimizer = torch.optim.Adam(self.parameters(), lr=self.learning_rate)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment