@@ -0,0 +1,983 @@
+import h5py%0Aimport numpy as np%0Aimport imageio%0Aimport glob, os%0A%0Aimport argparse%0Aparser = argparse.ArgumentParser()%0Aparser.add_argument('--train_dir', type=str, default=None)%0Aparser.add_argument('--output_file', type=str, default=None)%0Aparser.add_argument('--h', type=int, default=32)%0Aparser.add_argument('--w', type=int, default=32)%0Aparser.add_argument('--c', type=int, default=3)%0Aparser.add_argument('--n', type=int, default=8)%0Aargs = parser.parse_args()%0A%0Aif not args.train_dir or not args.output_file:%0A    raise ValueError()%0A%0AII = %5B%5D%0Afor file in sorted(glob.glob(os.path.join(args.train_dir, %22*.hy%22)), key=os.path.getmtime):%0A    print (file)%0A    f = h5py.File(file, 'r')%0A    I = np.zeros((args.n*args.h, args.n*args.w, args.c))%0A    for i in range(args.n):%0A        for j in range(args.n):%0A            I%5Bargs.h*i:args.h*(i+1), args.w*j:args.w*(j+1), :%5D = f%5Bf.keys()%5B0%5D%5D%5Bi*args.n+j,:,:,:%5D%0A    II.append(I)%0A%0AII = np.stack(II)%0Aprint II.shape%0Aimageio.mimsave(args.output_file, II, fps=5)%0A

add training visualization code