Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated code #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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):
"""
Expand Down