Closed Gooda97 closed 1 year ago
Hi @krasserm
First of all, thank you for this wonderful repo.
I've used these lines of code to work on my dataset:
lr_images_path = r'C:\Users\dell\Downloads\super_resolution\input' hr_images_path = r'C:\Users\dell\Downloads\super_resolution\output' file_paths_1 = sorted(sorted(glob.glob(os.path.join(lr_images_path, ".png")))) file_paths_2 = sorted(sorted(glob.glob(os.path.join(hr_images_path, ".png")))) lr_dataset = tf.data.Dataset.from_tensor_slices(file_paths_1) hr_dataset = tf.data.Dataset.from_tensor_slices(file_paths_2) def load_and_preprocess_image(file_path): image = tf.io.read_file(file_path) image = tf.image.decode_png(image, channels=3) image = tf.image.convert_image_dtype(image, tf.float32) return image lr_dataset = lr_dataset.map(load_and_preprocess_image) hr_dataset = hr_dataset.map(load_and_preprocess_image) combined_dataset = tf.data.Dataset.zip((lr_dataset, hr_dataset)) batched_dataset = combined_dataset.batch(1) prefetched_dataset = batched_dataset.prefetch(tf.data.experimental.AUTOTUNE) DATASET_SIZE= len(prefetched_dataset) train_size = int(0.97 * DATASET_SIZE) test_size = DATASET_SIZE - train_size train_dataset = prefetched_dataset.take(train_size) test_dataset = prefetched_dataset.skip(train_size)
and the training ran successfully but the PSNR had only slight changes and the output was so noisy.
could you help me with this.
Thanks in advance.
Hi @krasserm
First of all, thank you for this wonderful repo.
I've used these lines of code to work on my dataset:
and the training ran successfully but the PSNR had only slight changes and the output was so noisy.
could you help me with this.
Thanks in advance.