diff --git a/modules/deeplearning/esrgan_exp.py b/modules/deeplearning/esrgan_exp.py index dbdbfeab174c860242fa3248c1aa81e69a25e0a7..4153cc9a5ba36922ddee312e0ed78e4c0a8847a9 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