We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 95730fc commit 528f78eCopy full SHA for 528f78e
model.py
@@ -24,16 +24,15 @@ class Dataset:
24
25
def __init__(self, fnames):
26
self.fnames = fnames
27
+ self.data = io.imread_collection(fnames)
28
29
def __getitem__(self, index):
30
if index >= len(self):
31
raise StopIteration
32
- fname = self.fnames[index]
33
- img = io.imread(fname)
34
# TODO revert this at some point
35
- img = img[::5, ::5]
36
- return custom_types.Image(fname=fname, image=img)
+ img = self.data[index][::5, ::5]
+ return custom_types.Image(fname=self.fnames[index], image=img)
37
38
def __len__(self):
39
return len(self.fnames)
0 commit comments