sg-nm / Evolutionary-Autoencoders

Exploiting the Potential of Standard Convolutional Autoencoders for Image Restoration by Evolutionary Search (ICML 2018)
MIT License
72 stars 21 forks source link

dataset #1

Open Brave111 opened 6 years ago

Brave111 commented 6 years ago

i want to know if change another dataset ,how do it ?can you briefly introduce it?

sg-nm commented 6 years ago

For both the inpainting and denoising tasks, you can use another dataset by changing the script "cnn_train.py" and "exp_main.py". You need to specify the location of the dataset in the init function of cnn_train.py. For example:

if dataset_name == 'XXX':
    data_transform = transforms.Compose([transforms.ToTensor()])
    test_data_transform = transforms.Compose([transforms.ToTensor()])
    dataset = dset.ImageFolder(root='location of dataset XXX/train', transform=data_transform)
    test_dataset = dset.ImageFolder(root='location of dataset XXX/val', transform=test_data_transform)
    self.dataloader = torch.utils.data.DataLoader(dataset, batch_size=self.batchsize, shuffle=True, 
       num_workers=int(num_work), drop_last=True)
    self.test_dataloader = torch.utils.data.DataLoader(test_dataset, batch_size=1, shuffle=False, 
       num_workers=int(num_work))

Then you need to specify the name "XXX" in exp_main.py: eval_f = CNNEvaluation(gpu_num=args.gpu_num, epoch_num=20, dataset='XXX', verbose=True, imgSize=imgSize, batchsize=16, mask=args.mask)