From 54164bf1fff217cb2610d3208acaa3a1d7bb8f47 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Sun, 8 Oct 2023 13:12:21 -0500 Subject: [PATCH] snapshot... --- modules/deeplearning/esrgan_exp.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/modules/deeplearning/esrgan_exp.py b/modules/deeplearning/esrgan_exp.py index dbdbfeab..4153cc9a 100644 --- a/modules/deeplearning/esrgan_exp.py +++ b/modules/deeplearning/esrgan_exp.py @@ -88,18 +88,6 @@ def preprocess_image(hr_image): Args: image_path: Path to the image file """ - # hr_image = tf.image.decode_image(tf.io.read_file(image_path)) - # If PNG, remove the alpha channel. The model only supports - # images with 3 color channels. - if hr_image.shape[-1] == 4: - hr_image = hr_image[..., :-1] - elif len(hr_image.shape) == 2: - tmp_image = np.zeros([hr_image.shape[0], hr_image.shape[1], 3]) - tmp_image[:, :, 0] = hr_image - tmp_image[:, :, 1] = hr_image - tmp_image[:, :, 2] = hr_image - hr_image = tmp_image - hr_image *= 255.0 hr_image *= 255.0 -- GitLab