MCPcopy Create free account
hub / github.com/carpedm20/DCGAN-tensorflow / imread

Function imread

utils.py:49–57  ·  view source on GitHub ↗
(path, grayscale = False)

Source from the content-addressed store, hash-verified

47 return imsave(inverse_transform(images), size, image_path)
48
49def imread(path, grayscale = False):
50 if (grayscale):
51 return scipy.misc.imread(path, flatten = True).astype(np.float)
52 else:
53 # Reference: https://github.com/carpedm20/DCGAN-tensorflow/issues/162#issuecomment-315519747
54 img_bgr = cv2.imread(path)
55 # Reference: https://stackoverflow.com/a/15074748/
56 img_rgb = img_bgr[..., ::-1]
57 return img_rgb.astype(np.float)
58
59def merge_images(images, size):
60 return inverse_transform(images)

Callers 2

get_imageFunction · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected