The problem is there is no much you can do about it. Have you check it’s not an IO problem?
PILLOW-SIMD is drop-in, totally compatible with PIL.
BTW, after seeing this line transforms.RandomResizedCrop(1024 I realized you are working with high resolution images. That’s probably the reason why it takes ages.
Another thing you can consider is to implement your own transforms for tensors. This way you can preprocess normalization.
You can also crop and resize 1st, this way rotation will take less time