MCPcopy Create free account
hub / github.com/apache/singa / resize_dataset

Function resize_dataset

examples/cnn/train_cnn.py:84–94  ·  view source on GitHub ↗
(x, image_size)

Source from the content-addressed store, hash-verified

82
83
84def resize_dataset(x, image_size):
85 num_data = x.shape[0]
86 dim = x.shape[1]
87 X = np.zeros(shape=(num_data, dim, image_size, image_size),
88 dtype=np.float32)
89 for n in range(0, num_data):
90 for d in range(0, dim):
91 X[n, d, :, :] = np.array(Image.fromarray(x[n, d, :, :]).resize(
92 (image_size, image_size), Image.BILINEAR),
93 dtype=np.float32)
94 return X
95
96
97def run(global_rank,

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected