text_plain_output_1.png
from keras.preprocessing.image import ImageDataGenerator, load_img, img_to_array

import matplotlib.pyplot as plt

import numpy as np

datagen = ImageDataGenerator(rescale=1.0 / 255)
train_generator = datagen.flow_from_directory('../input/train/', batch_size=1, class_mode='categorical')

x, y = train_generator.next()
plt.imshow((x[0] * 255).astype('uint8'))
print(list(train_generator.class_indices.keys())[np.argmax(y)])