How can I load many image files with Tensorflow

I am currently in the Happy Whale competition. In it, there are 50,000 images of various whales and from which species they belong. I was trying to load these images with the tf dataset is there any efficient way to do load these many images with their labels?

Hi @Pritish_Mishra, You can load those images as tf dataset using file_pattern).

If the images are organized properly into directories and sub-directories like all the images to a specific label are stored in one sub-directory (name of sub directory must be the label name)


then you can load the images using tf.keras.utils.image_dataset_from_directory( ). Thank You.

1 Like