Show_batch question what are the image file names in the batch

Is there a way to identify the images selected to show in the show_batch function in fastai v3?
If somehow I could obtain the idxs of the dataset which the batch constitutes that will help.

Thank you in advance


You can’t do that directly since the training dataloader shuffles the data by default (so the images are not the first items). If you use the validation dataloader, it loads the image in order, so you can find their filenames in data.valid_ds.items[0] (or 1, 2, …)


Thank you sir,
Is it possible to call show_batch with ds_type=DatasetType.Train but shuffle=False?

That’s DatasetType.Fix (training set, but no data augmentation and suffle=False).

Awesome ! Thanks !!