I’m wondering if there’s a way to alter the torch.utils.data.DataLoader so that one could import FITS files into Pytorch as tensors with labels?
I’m intending to load in Astronomical images from FITS format (http://docs.astropy.org/en/stable/index.html 3) and presumably in the source code for DataLoader there must be some function for handling different data types such as: .jpg, .png etc.
Perhaps if there’s no simple clause for directly importing FITS files, I could be pointed towards that function and I can insert my own FITS handler clause?
Given that my code looks as follows when importing the training set:
trainset = dset.ImageFolder(root="/Documents/Image_data",transform=transform)
train_loader = torch.utils.data.DataLoader(trainset, batch_size=batch_size,shuffle=True)

…and I haven’t been able to find the data type handling functions in the source code for torch.utils.data.DataLoader or torch.utils.data.Dataset, maybe someone could point me in the right direction?
Many thanks in advance!