Image generator from images instead of folders (Segmentation task)

I have a dataset with high resolution images, instead of using the whole image i want to create a sliding window to generate images for training(random crop is not useful as it may not use the whole image for training). This is possible using keras generator but can this be done using fastai

I’ve been trying to do something similar - 100x100px tiles from 2k px images in the Div2K dataset - on a super resolution task using a custom ImageImageList. So far I’ve managed to get the x's with a custom open function but I’ve not been able to match the y's as yet, though the code for SegmentationLabelList points to how it might be done. I see examples in pytorch - quite simple - but am still getting my head around fastai’ing it.

The question has been asked before, eg Lesson 3 Advanced Discussion ✅ and Split large satellite image into tiles/patches?

Conventionally in fastai one creates and saves files of crops but ideally I’d like to generate my x/y crops on the fly without saving more files.

If anyone has made progress in the area, please chime in.

@digitalspecialists Did you manage to do this? I’m trying to apply multiple labels to multiple bounding boxes (see here), so am interested in this!