MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / __init__

Method __init__

SRGAN/dataset.py:16–26  ·  view source on GitHub ↗
(self, root_dir)

Source from the content-addressed store, hash-verified

14
15class MyImageFolder(Dataset):
16 def __init__(self, root_dir):
17 super(MyImageFolder, self).__init__()
18 self.data = []
19 self.root_dir = root_dir
20 self.class_names = os.listdir(root_dir)
21
22 for index, name in enumerate(self.class_names):
23 files = os.listdir(os.path.join(root_dir, name))
24 self.data += list(zip(files, [index] * len(files)))
25 # print('self.data: {}'.format(self.data))
26 # break
27
28 def __len__(self):
29 return len(self.data)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected