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

from tqdm import tqdm

from tqdm import tqdm

import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

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()

X_data, Y_data = ([], [])
for _ in tqdm(range(2750)):
    x, y = train_generator.next()
    X_data.append(x[0])
    Y_data.append(y[0])
X_data = np.asarray(X_data)
Y_data = np.asarray(Y_data)

X_test = []
sub = pd.read_csv('../input/sample_submission.csv')
for fname in tqdm(sub['fname']):
    filepath = '../input/test/' + fname
    X_test.append(img_to_array(load_img(filepath, target_size=(256, 256))))
X_test = np.asarray(X_test)