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

Function resize_dataset

examples/cnn_ms/train_cnn.py:266–276  ·  view source on GitHub ↗
(x, image_size)

Source from the content-addressed store, hash-verified

264
265
266def resize_dataset(x, image_size):
267 num_data = x.shape[0]
268 dim = x.shape[1]
269 X = np.zeros(shape=(num_data, dim, image_size, image_size),
270 dtype=np.float32)
271 for n in range(0, num_data):
272 for d in range(0, dim):
273 X[n, d, :, :] = np.array(Image.fromarray(x[n, d, :, :]).resize(
274 (image_size, image_size), Image.BILINEAR),
275 dtype=np.float32)
276 return X
277
278
279def run(global_rank,

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected