Skip to content

ImageDataGenerator without classes #107548

Closed Answered by faridnec
TheStrange-007 asked this question in Programming Help
Discussion options

You must be logged in to vote

Hey, You can perhaps use the flow_from_directory method of ImageDataGenerator 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.

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
...................................................

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TheStrange-007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Programming Help Programming languages, open source, and software development.
2 participants