KerasHub preprocessing layers can be used to create custom preprocessing pipelines for pretrained models. Preprocessing layers are all compatible with tf.data, even when running on the jax and torch backends.
tf.data
jax
torch