We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85edbcd commit 5958538Copy full SHA for 5958538
utils.py
@@ -7,6 +7,7 @@
7
import random
8
import pprint
9
import scipy.misc
10
+import cv2
11
import numpy as np
12
from time import gmtime, strftime
13
from six.moves import xrange
@@ -36,7 +37,11 @@ def imread(path, grayscale = False):
36
37
if (grayscale):
38
return scipy.misc.imread(path, flatten = True).astype(np.float)
39
else:
- return scipy.misc.imread(path).astype(np.float)
40
+ # Reference: https://github.com/carpedm20/DCGAN-tensorflow/issues/162#issuecomment-315519747
41
+ img_bgr = cv2.imread(path)
42
+ # Reference: https://stackoverflow.com/a/15074748/
43
+ img_rgb = img[..., ::-1]
44
+ return img_rgb.astype(np.float)
45
46
def merge_images(images, size):
47
return inverse_transform(images)
0 commit comments