At the time of defining the dataset class you can read data there  so that it gets loaded in RAM (instead of reading  from hard disk)
You can also directly load them into the GPU (using the main thread) and preprocessing directly in the gpu.
The drawback is image preprocessing is PIL based, so you would have to reimplement them as pytorch functions.