Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Suggest to enrich the function family for image_dataset_from_directory #299

Open
L-Eriksson opened this issue Jun 3, 2020 · 6 comments
Open
Labels
image Related to images

Comments

@L-Eriksson
Copy link

L-Eriksson commented Jun 3, 2020

HI, I'm a researcher and have been using keras (with tf backend) for a long time. ImageDataGenerator.flow_from_directory has been my favourite method due to my data size. However, I feel that Dataset is recommended more than Generator method after tf2.x and keras also have image_dataset_from_directory function in tf.keras.preprocessing. So I switched to Dataset but met some inconvenience. For example, I can't find similar functions like previous test_gen.filenames and test_gen.class , which brought me some difficulty when I tried to match my predictions and file names. I finally managed it but not as neat as build-in functions like .filename.

Does the team have plan to enrich the functions? It would be very helpful. Thank you!

@L-Eriksson L-Eriksson added the image Related to images label Jun 3, 2020
@Dref360
Copy link
Contributor

Dref360 commented Jun 3, 2020

Hello,
We have a Keras community SIG this Friday (June 5th). I'll raise your issue there.

@L-Eriksson
Copy link
Author

@Dref360 Thank you! Shoud I expect feedback on this issue page or somewhere else?

@Dref360
Copy link
Contributor

Dref360 commented Jun 4, 2020

Yes I will report back on this issue.

@Dref360
Copy link
Contributor

Dref360 commented Jun 5, 2020

For your particular issue:
class_names is still an attribute (as can be seen here).

You can get all the information from dataset_utils.index_directory.

I know this is not ideal.

@Dref360
Copy link
Contributor

Dref360 commented Jun 5, 2020

From the Keras SIG:
With Keras preprocessing Layers coming out of experimental, there will be a lot of documentation on how to transition from the old API to the new.

In addition, I submitted an issue on your behalf on the Tensorflow Github. I can make the change pretty easily, but I want to be sure that the design will be accepted. tensorflow/tensorflow#40203

@L-Eriksson
Copy link
Author

Thanks for your update.
For the particular solutions:
I have tried them and they work. As you also stated, it's not ideal but could be one way to solve the issue.

For your submission on TF Github:
It's exactly what I mean and I also comment under that issue. I would wait for further information.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
image Related to images
Projects
None yet
Development

No branches or pull requests

2 participants