diff --git a/main.py b/main.py index 4661e72..75addb0 100644 --- a/main.py +++ b/main.py @@ -2,7 +2,7 @@ from utils import input_setup import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf import pprint import os diff --git a/model.py b/model.py index dbe6d74..c70ba4b 100644 --- a/model.py +++ b/model.py @@ -10,7 +10,7 @@ import matplotlib.pyplot as plt import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf try: xrange diff --git a/utils.py b/utils.py index 124dd3b..94bcf2c 100644 --- a/utils.py +++ b/utils.py @@ -9,11 +9,11 @@ import matplotlib.pyplot as plt from PIL import Image # for loading images as YCbCr format -import scipy.misc +import imageio.v3 import scipy.ndimage import numpy as np -import tensorflow as tf +import tensorflow.compat.v1 as tf try: xrange @@ -97,9 +97,9 @@ def imread(path, is_grayscale=True): Default value is gray-scale, and image is read by YCbCr format as the paper said. """ if is_grayscale: - return scipy.misc.imread(path, flatten=True, mode='YCbCr').astype(np.float) + return imageio.imread(path, pilmode='YCbCr').astype(np.float)[:, :, 0] else: - return scipy.misc.imread(path, mode='YCbCr').astype(np.float) + return imageio.imread(path, pilmode='YCbCr').astype(np.float) def modcrop(image, scale=3): """