ImageDataGenerator without classes #107548
-
BodyHow can I use the ImageDataGenerator in Keras to handle images without organizing them into separate classes within folders? For example, if I have a collection of images for training that aren't categorized into separate folders for classes. I want to utilize the grayscale version of the respective image as the input (X) and its RGB counterpart as the output (y). Guidelines
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey, You can perhaps use the train_generator = datagen.flow_from_directory(
train_dir,
target_size=(image_height, image_width),
batch_size=batch_size,
class_mode=None, # Set class_mode to None since there are no classes
................................................... |
Beta Was this translation helpful? Give feedback.
Hey, You can perhaps use the
flow_from_directory
method ofImageDataGenerator
in Keras to handle images even if they are not organized into separate classes within folders. Instead of organizing images into separate class folders, you can organize them all into a single directory and specify the class_mode parameter as None. This tells Keras not to expect subdirectories for classes.