https://pytorch.org/tutorials/beginner/data_loading_tutorial.html 7
Pytorch’s tutorial is extensive enough. You can push in all of the heavy lifting in the Dataset’s getitem attribute including loading using PIL and conversion to torch.