This is simply implemented with an ImageFolder dataset.
The data is preprocessed as described here
Here is an example