Also you can check out pytorch’s tutorial on building custom Datsets:
http://pytorch.org/tutorials/beginner/data_loading_tutorial.html#dataset-class 41
Which you can then wrap with DataLoader as any regular Dataset