Esempio n. 1
0
def create_valid_awgn_dataloaders(patchsize, batchsize):
    transform_valid = Compose([
        sar_dataset.CenterCropPil(patchsize),
        sar_dataset.PilToGrayTensor(bayes=0.0,scale=scale_img),
    ])

    validset = sar_dataset.PlainImageFolder(dirs=folders_data.valid68_dir, transform=transform_valid, cache=True)
    validloader = torch.utils.data.DataLoader(validset, batch_size=batchsize, shuffle=False, num_workers=1)

    return validloader
Esempio n. 2
0
def create_train_awgn_dataloaders(patchsize, batchsize, trainsetiters):
    transform_train = Compose([
        sar_dataset.RandomCropPil(patchsize),
        sar_dataset.Random8OrientationPil(),
        sar_dataset.PilToGrayTensor(bayes=0.0, scale=scale_img),
    ])

    trainset = sar_dataset.PlainImageFolder(dirs=folders_data.train400_dir, transform=transform_train, cache=True)
    trainset = torch.utils.data.ConcatDataset([trainset]*trainsetiters)
    trainloader = torch.utils.data.DataLoader(trainset, batch_size=batchsize, shuffle=True, num_workers=20)

    return trainloader
Esempio n. 3
0
def create_train_syncsar_dataloaders_old(patchsize, batchsize, trainsetiters):
    import torchvision.transforms as transforms
    transform_train = Compose([
        transforms.RandomCrop(patchsize),
        sar_dataset.RandomOrientation90Pil(),
        #sar_dataset.Random8OrientationPil(),
        transforms.RandomVerticalFlip(),
        sar_dataset.ToGrayscale(),
        transforms.ToTensor(),
        sar_dataset.AddBayes(),
    ])

    train_folders = folders_data.train400_dir

    trainset = sar_dataset.PlainImageFolder(dirs=train_folders, transform=transform_train, cache=True)
    trainset = torch.utils.data.ConcatDataset([trainset] * trainsetiters)
    trainloader = torch.utils.data.DataLoader(trainset, batch_size=batchsize, shuffle=True, num_workers=20)

    return trainloader