def __init__(self, rgb_dir, target_transform=None): super(DataLoaderVal, self).__init__() self.target_transform = target_transform clean_files = sorted(os.listdir(os.path.join(rgb_dir, 'clean'))) noisy_files = sorted(os.listdir(os.path.join(rgb_dir, 'noisy'))) self.clean_filenames = [ os.path.join(rgb_dir, 'clean', x) for x in clean_files if is_png_file(x) ] self.noisy_filenames = [ os.path.join(rgb_dir, 'noisy', x) for x in noisy_files if is_png_file(x) ] self.tar_size = len(self.clean_filenames)
def __init__(self, rgb_dir, p=0.2, transform=None): super(DataLoaderTrain, self).__init__() clean_files = sorted(os.listdir(os.path.join(rgb_dir, 'clean'))) noisy_files = sorted(os.listdir(os.path.join(rgb_dir, 'noisy'))) self.clean_filenames = [ os.path.join(rgb_dir, 'clean', x) for x in clean_files if is_png_file(x) ] self.noisy_filenames = [ os.path.join(rgb_dir, 'noisy', x) for x in noisy_files if is_png_file(x) ] self.rgb_size = len(self.clean_filenames) # get the size of input self.transform = transform self.p = p
def __init__(self, rgb_dir, target_transform=None): super(DataLoaderTestSR, self).__init__() self.target_transform = target_transform LR_files = sorted(os.listdir(os.path.join(rgb_dir))) self.LR_filenames = [ os.path.join(rgb_dir, x) for x in LR_files if is_png_file(x) ] self.tar_size = len(self.LR_filenames)
def __init__(self, rgb_dir): super(DataLoader_NoisyData, self).__init__() rgb_files = sorted(os.listdir(rgb_dir)) #print("number of images:", len(rgb_files)) self.target_filenames = [ os.path.join(rgb_dir, x) for x in rgb_files if is_png_file(x) ] self.tar_size = len(self.target_filenames) # get the size of target self.blur, self.pad = get_gaussian_kernel( kernel_size=5, sigma=1 ) ### preprocessing to remove noise from the input rgb image
def __init__(self, rgb_dir, transform=None): super(DataLoader_NoisyData, self).__init__() rgb_files = sorted(os.listdir(rgb_dir)) self.target_filenames = [] #print("number of images:", len(rgb_files)) for path in rgb_files: if os.path.isfile(os.path.join(rgb_dir, path)): if is_png_file(path) or is_image_file(path): self.target_filenames.append(os.path.join(rgb_dir, path)) else: files = sorted(os.listdir(os.path.join(rgb_dir, path))) for file in files: if is_image_file(file) or is_png_file(file): self.target_filenames.append( os.path.join(rgb_dir, path, file)) self.tar_size = len(self.target_filenames) # get the size of target self.blur, self.pad = get_gaussian_kernel( kernel_size=5, sigma=1) # preprocessing to remove noise from the input rgb image self.transform = transform