I have a tf.data.Dataset of image paths of image and masks
# Creating list of image and mask path
all_val_img = np.array(sorted([os.path.join(VAL_DIR,i) for i in os.listdir(VAL_DIR)]))
all_val_mask = np.array(sorted([os.path.join(VAL_MASK_DIR,i) for i in os.listdir(VAL_MASK_DIR)]))
# doing tf.data.Dataset
val_data = tf.data.Dataset.from_tensor_slices((all_val_img, all_val_mask))
mapping a function to turn paths into images
#mapping the function
val_data = val_data.map(make_image)
Now How do i Augment it . I do not want to use ImageDataGenerator
as tf says Deprecated: tf.keras.preprocessing.image.ImageDataGenerator is not recommended for new code.
Note: Both Image and Mask needs to be augmented the same way.