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

import os

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

proj_dir = '../input/cassava-leaf-disease-classification/train_images/'
train = pd.read_csv('../input/cassava-leaf-disease-classification/train.csv')
train.loc[:, 'label'] = train.loc[:, 'label'].astype('str')
BATCH_SIZE = 64
SPLIT = 0.2

train_datagen_v2 = ImageDataGenerator(rescale=1.0 / 255, horizontal_flip=True)
test_datagen_v2 = ImageDataGenerator(rescale=1.0 / 255)
train_generator = train_datagen_v2.flow_from_dataframe(train, directory=proj_dir, x_col='image_id', y_col='label', target_size=(448, 448), batch_size=BATCH_SIZE, class_mode='categorical')
test_dir = '../input/cassava-leaf-disease-classification/test_images/'
test = pd.DataFrame()
test['image_id'] = os.listdir('../input/cassava-leaf-disease-classification/test_images/')
test_generator = test_datagen_v2.flow_from_dataframe(test, directory=test_dir, x_col='image_id', target_size=(448, 448), batch_size=1, class_mode=None, shuffle=False)

train_generator.class_indices