Computer Vision News - April 2023

34 Medical Imaging Tools # combine known and unknown using the mask val_image_inpainted = torch.where( mask == 1, val_image_inpainted_prev_known, val_image_ inpainted_prev_unknown ) # perform resampling if t > 0 and u < (num_resample_steps - 1): # sample x_t from x_t-1 noise = torch.randn((1, 1, 64, 64)).to(device) val_image_inpainted = ( torch.sqrt(1 - scheduler.betas[t - 1]) * val_im- age_inpainted + torch.sqrt(scheduler.betas[t - 1]) * noise 3D RECONSTRUCTION WITH VQVAE from generative.networks.nets import VQVAE from torch.nn import L1Loss from monai.apps import DecathlonDataset Model: VQVAE model = VQVAE( spatial_dims=3, in_channels=1, out_channels=1, num_channels=(256, 256), num_res_channels=256, num_res_layers=2, downsample_parameters=((2, 4, 1, 1), (2, 4, 1, 1)), upsample_parameters=((2, 4, 1, 1, 0), (2, 4, 1, 1, 0)), num_embeddings=256, embedding_dim=32, ) model.to (device) Parameters: Adam Optimiser and L1 Loss optimizer = torch.optim.Adam(params=model.parameters(), lr=1e-4) l1_loss = L1Loss()

RkJQdWJsaXNoZXIy NTc3NzU=