I assume you’ve already calculated the eigenvectors and would like to transform each image using the them?
If so, you could lazily load your images in your Dataset's __getitem__ function and apply the PCA there.
Have a look at the data loading tutorial 301 for more information on Dataset and DataLoader.