Keras / Tensorflow で使う学習データセットからテクスチャアトラスを作成するコードを書きました。デバッグ、学習データセット作成の練習も兼ねています。 学習データセット CIFAR10 Small Images https://keras.io/datasets/ https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz 図 今回、生成したテクスチャアトラス(拡大) 図 生成したテクスチャアトラスの全体 8,000 x 6,400 texels (250 x 200 images) コード # source: https://github.com/keras-team/keras/blob/master/examples/cifar10_cnn.py # morishige, 2018 from keras.datasets import cifar10 # The data, shuffled and split between train and test sets: (x_train, y_train), (x_test, y_test) = cifar10.load_data() print('x_train shape:', x_train.shape) print(x_train.shape[0], 'train samples') print(x_test.shape[0], 'test samples') # for debug import numpy as np from PIL import Image def img_show(img, atlasX, atlasY): pil_img = Image.fromarray(np.uint8(img)) pil_img.show() img_name = 'cifar10_atlas_' + str(atlasY) + 'x' + str(atlasX) + '.jpg' pil_img.save(img_name) # get information im