text_html_output_1.png
from tensorflow.keras.preprocessing.image import ImageDataGenerator

import pandas as pd

train_dir = '/kaggle/input/hackerearth/dataset/Train Images'
test_dir = '/kaggle/input/hackerearth/dataset/Test Images'

train = pd.read_csv('/kaggle/input/hackerearth/dataset/train.csv')

datagen = ImageDataGenerator(rescale=1.0 / 255.0, validation_split=0.2)

train_it = datagen.flow_from_dataframe(train, directory=train_dir, x_col='Image', y_col='Class', target_size=(150, 150), class_mode='categorical', batch_size=32, subset='training', shuffle=True)
valid_it = datagen.flow_from_dataframe(train, directory=train_dir, x_col='Image', y_col='Class', target_size=(150, 150), class_mode='categorical', subset='validation', batch_size=32, shuffle=True)