To complement @ruotianluo’s answer, here 3.4k you can find an example usage of data loaders. Also keep in mind that they work with all kinds of datasets, not only vision! (A dataset is just an object that defines two methods as in here 632).