autogluon / autogluon

Fast and Accurate ML in 3 Lines of Code
https://auto.gluon.ai/
Apache License 2.0
8.04k stars 928 forks source link

Custom dataset with pytorch #4432

Open olegkorshunov opened 2 months ago

olegkorshunov commented 2 months ago

Sometimes we have dataset with different formats for exampl in hdf5

and it would be nice to be able to write your own dataset that would return a picture and a label

from torch.utils.data import Dataset

class CustomImageClassificationDataset(Dataset):
    def __init__(self): pass
    def __len__(self): pass
    def __getitem__(self, idx):
        ...
        return image, label