The code looks fine!
You could use PIL or PIL-SIMD to load the images, as the torchvision transformations are defined for PIL.Images (e.g. random cropping etc.).
If you don’t need image data augmentations, you are good to go.