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

Method __init__

intermediate_source/torchvision_tutorial.py:148–154  ·  view source on GitHub ↗
(self, root, transforms)

Source from the content-addressed store, hash-verified

146
147class PennFudanDataset(torch.utils.data.Dataset):
148 def __init__(self, root, transforms):
149 self.root = root
150 self.transforms = transforms
151 # load all image files, sorting them to
152 # ensure that they are aligned
153 self.imgs = list(sorted(os.listdir(os.path.join(root, "PNGImages"))))
154 self.masks = list(sorted(os.listdir(os.path.join(root, "PedMasks"))))
155
156 def __getitem__(self, idx):
157 # load images and masks

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected