I'm working on CNN model and I'm curious to know-how converts the output given by datagen.flow\_from\_directory() into a bumpy array. The format of datagen.flow\_from\_directory() is directoryiterator.

Apart from ImageDataGenerator is any other way also to fetch data from the directory. 

```
img_width = 150
img_height = 150

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

train_data_gen =  directory='/content/xray_dataset_covid19',
                                             target_size = (img_width, img_height),
                                             class_mode='binary',
                                             batch_size=16,
                                             subset='training')

vali_data_gen = datagen.flow_from_directory(directory='/content/xray_dataset_covid19',
                                             target_size = (img_width, img_height),
                                             class_mode='binary',
                                             batch_size=16,
                                             subset='validation')

```