image_output_1.png
import h5py

import matplotlib.pylab as plt

import numpy as np

import pandas as pd

data = pd.read_csv('../input/letters.csv')
files = data['file']
letters = data['letter']
backgrounds = data['background']

f = h5py.File('../input/LetterColorImages.h5', 'r')
keys = list(f.keys())
keys

backgrounds = np.array(f[keys[0]])
tensors = np.array(f[keys[1]])
targets = np.array(f[keys[2]])

fig, ax = plt.subplots(figsize=(18, 3), nrows=1, ncols=5, sharex=True, sharey=True)
ax = ax.flatten()
for i in range(5):
    image = tensors[i * 200] / 255
    ax[i].imshow(image)
ax[0].set_xticks([])
ax[0].set_yticks([])
plt.tight_layout()
plt.gcf()
ax[2].set_title('Examples of letters', fontsize=25)