Beispiel #1
0
def get_training_set(data_dir, upscale_factor, patch_size, data_augmentation):
    hr_dir = join(data_dir, 'HR')
    lr_dir = join(data_dir, 'LR')
    return DatasetFromFolder(hr_dir,
                             lr_dir,
                             patch_size,
                             upscale_factor,
                             data_augmentation,
                             transform=transform())
Beispiel #2
0
def get_test_set(upscale_factor):
    root_dir = download_bsd300()
    test_dir = join(root_dir, "test")
    crop_size = calculate_valid_crop_size(256, upscale_factor)

    return DatasetFromFolder(test_dir,
                             input_transform=input_transform(
                                 crop_size, upscale_factor),
                             target_transform=target_transform(crop_size))
Beispiel #3
0
def create_famous_dataset(test_path, noise, pad):

    def pre_process_fn(_x):
        return normilize(_x, 255)

    def input_process_fn(_x):
        return gaussian(_x, is_training=True, mean=0, stddev=normilize(noise, 255))

    return DatasetFromFolder(
                test_path,
                pre_transform=pre_process_fn,
                use_cuda=USE_CUDA,
                inputs_transform=input_process_fn
            )
Beispiel #4
0
def create_test_dataset(test_path, noise, pad):

    def pre_process_fn(_x):
        return normilize(_x, 255)

    def input_process_fn(_x):
        return gaussian(_x, is_training=True, mean=0, stddev=normilize(noise, 255))

    file_of_filenames =\
            os.path.join(common.project_dir(), 'pascal2010_test_imgs.txt')

    return DatasetFromFolder(
                test_path,
                file_of_filenames=file_of_filenames,
                pre_transform=pre_process_fn,
                use_cuda=USE_CUDA,
                inputs_transform=input_process_fn
            )