MCPcopy Create free account
hub / github.com/pytorch/tutorials / __init__

Method __init__

beginner_source/basics/data_tutorial.py:126–130  ·  view source on GitHub ↗
(self, annotations_file, img_dir, transform=None, target_transform=None)

Source from the content-addressed store, hash-verified

124
125class CustomImageDataset(Dataset):
126 def __init__(self, annotations_file, img_dir, transform=None, target_transform=None):
127 self.img_labels = pd.read_csv(annotations_file)
128 self.img_dir = img_dir
129 self.transform = transform
130 self.target_transform = target_transform
131
132 def __len__(self):
133 return len(self.img_labels)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected