I'm currently trying to use tf.keras.preprocessing.image_dataset_from_directory to create a dataset but I'm running into a couple of problems
- I can't insert a numpy/cv2 preprocessing step before conversion to tensors. I can use tf.data.Dataset.map but that means I have to unbatch, convert to numpy array, do the preprocessing ... and so on. I tried this but I keep running into little bugs that are fixable, but I'm getting the feeling it wasn't designed to be used this way.
- I don't have much control over the way the train/val split is done. I want to do do a particular KFold splitting.
FYI I'm used to doing this in PyTorch via custom Datasets and DataLoaders.