MCPcopy Create free account
hub / github.com/Newmu/dcgan_code / grayscale_grid_vis

Function grayscale_grid_vis

lib/vis.py:4–13  ·  view source on GitHub ↗
(X, (nh, nw), save_path=None)

Source from the content-addressed store, hash-verified

2from scipy.misc import imsave
3
4def grayscale_grid_vis(X, (nh, nw), save_path=None):
5 h, w = X[0].shape[:2]
6 img = np.zeros((h*nh, w*nw))
7 for n, x in enumerate(X):
8 j = n/nw
9 i = n%nw
10 img[j*h:j*h+h, i*w:i*w+w] = x
11 if save_path is not None:
12 imsave(save_path, img)
13 return img
14
15def color_grid_vis(X, (nh, nw), save_path=None):
16 h, w = X[0].shape[:2]

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected