Posted on 17th September 2024|390 views
What are the commonly used attributes along with flow_from_directory()?
Posted on 17th September 2024| views
I will show you all the commonly used attributes by the following example
train_generator = train_datagen.flow_from_directory(
directory=r"./train/",
target_size=(230, 230),
color_mode="rgb",
batch_size=32,
class_mode="categorical",
shuffle=True,
seed=40
)
The directory should be set to the path where the classes of the folder are there.
The target size is the size of our input image.
The color mode is to determine the color of the image whether black, white or grayscale if the image is grayscale then set "grayscale" or else is the image contain the three colors then set "rgb".
The batch size is the number of images to be produced from the generator.
The class mode has to be set "binary" if there are just two classes if not, we can set it to "categorical".
The shuffle if we want to shuffle the order of the image then we can set the shuffle as "true", or else we can set if as "false".
Seed random seed for implementing the random image.