Dataloaders with multiple different sources

New to FastAI. I am following the typical workflow described in the book and the tutorials, where I build a DataBlock, a dataloader, a model, and a learner (from the dls, the model, and some loss function). So far so good.

But what if I have multiple kinds of data collections? My training data is images. I have several collections of images, each with different sizes, labeled differently (labeled via file names, via CSV files, etc). I want to keep the original folder structure of all these different data collections.

Is it possible to have a single dls that pulls images from all these different locations, processes them differently based on source path, and feeds them to the model during training / validation? The splitter would also have to split each source path individually, to make sure I train / validate with images from all source paths.

Are there any code examples that do this?

Yes there’s quite a few tutorials in the fastai docs - it’ll probably be easiest to use the mid-tier API, so take a look at stuff like the Pets tutorial in the docs.