lo(number_images)array[100, 64, 64, 3] n=1228800 xโ[0., 1.000] ฮผ=0.784 ฯ=0.171
# We need to form the images inro a rectangular area. For this, we might
# need to add some dummy images to the last row, whoch might be not be full.
n_extra_images = n_rows*n_cols - t.shape[0]
if n_extra_images:
extra_images = np.ones((n_extra_images, *t.shape[1:]))
# extra_images = torch.ones((n_extra_images, *t.shape[1:]))
t = np.concatenate([ t, extra_images ])# This is where the fun begins! Imagine 't' is tensor[20, 128, 128, 3].
# and we want 5 rows, 4 columns each.
t = t.reshape(n_rows, n_cols, *t.shape[-3:])
# Now t is tensor[5, 4, 128, 128, 3]
t = t.transpose(0, 2, 1, 3, 4)
# now t is tensor[5, 128, 4, 128, 3]
# If we just squick dimensions 0,1 and 2,3 togerther, we get the image we want.
t = t.reshape(n_rows*xy_shape[0], n_cols*xy_shape[1], n_channels)Tile images in a grid.
Combine with utils.pad.pad_frame_gutters to make it look better
Recursively tile images on a 2d grid
array[2, 5, 10, 64, 64, 3] n=1228800 xโ[0., 1.000] ฮผ=0.784 ฯ=0.171