I am looking into the R package keras and the function image_dataset_from_directory()
According to the help page,
If your directory structure is:
main_directory/
...class_a/
......a_image_1.jpg
......a_image_2.jpg
...class_b/
......b_image_1.jpg
......b_image_2.jpg
Then calling ‘image_dataset_from_directory(main_directory, labels='inferred')’ will return a ‘tf.data.Dataset’ that yields batches of images from the subdirectories class_a and class_b, together with labels 0 and 1 (0 corresponding to class_a and 1 corresponding to class_b).
However, I have three folders:
main_directory/
...class_a/
......a_image_1.jpg
......a_image_2.jpg
...
...class_b/
......b_image_1.jpg
......b_image_2.jpg
...
...class_c/
......c_image_1.jpg
......c_image_1.jpg
...
I want to read only two of these classes (and ignore the third). Is there a way to do this using the image_dataset_from_directory() or some other function?