If we create a databunch that goes from image to image .show_batch
will overlay all images with the label image.
Minimal example:
path = untar_data(URLs.IMAGEWOOF)
dblock = DataBlock(blocks=(ImageBlock, ImageBlock),
get_items=get_image_files,
splitter=GrandparentSplitter(valid_name='val'),
get_y=lambda x: (path/'train').ls()[0].ls()[0],
)
dbch = dblock.databunch(path, bs=bs, item_tfms=[Resize(128)])
dbch.show_batch()