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

Function resize_dataset

examples/cnn_ms/train_ms_model.py:259–269  ·  view source on GitHub ↗
(x, image_size)

Source from the content-addressed store, hash-verified

257
258
259def resize_dataset(x, image_size):
260 num_data = x.shape[0]
261 dim = x.shape[1]
262 X = np.zeros(shape=(num_data, dim, image_size, image_size),
263 dtype=np.float32)
264 for n in range(0, num_data):
265 for d in range(0, dim):
266 X[n, d, :, :] = np.array(Image.fromarray(x[n, d, :, :]).resize(
267 (image_size, image_size), Image.BILINEAR),
268 dtype=np.float32)
269 return X
270
271
272def run(global_rank,

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected