Aymen_Sekhri:

Especially in computer vision where All datasets follow certain organizational patterns and there are built-in functions to load the data easily (in torchvision).


While some public datasets follow a specific pattern (and thus can be loaded using a torchvision dataset), a custom Dataset gives you the ability to load your custom dataset using any logic you want. I.e. you don’t have to follow a specific folder structure, can apply transformations using different conditions, could create the target using a custom logic etc.