Update renovation.py
Browse files- renovation.py +5 -2
renovation.py
CHANGED
@@ -77,6 +77,7 @@ class Renovations(datasets.GeneratorBasedBuilder):
|
|
77 |
]
|
78 |
|
79 |
def _generate_examples(self, data_files, split):
|
|
|
80 |
for label, path in data_files.items():
|
81 |
files = glob.glob(path + '/*.jpeg', recursive=True)
|
82 |
random.shuffle(files)
|
@@ -88,10 +89,12 @@ class Renovations(datasets.GeneratorBasedBuilder):
|
|
88 |
else:
|
89 |
files = files[int(num_files*0.85):]
|
90 |
|
91 |
-
for
|
92 |
-
yield
|
93 |
"image_file_path": file,
|
94 |
"image": file,
|
95 |
"labels": label,
|
96 |
}
|
|
|
|
|
97 |
|
|
|
77 |
]
|
78 |
|
79 |
def _generate_examples(self, data_files, split):
|
80 |
+
idx = 0
|
81 |
for label, path in data_files.items():
|
82 |
files = glob.glob(path + '/*.jpeg', recursive=True)
|
83 |
random.shuffle(files)
|
|
|
89 |
else:
|
90 |
files = files[int(num_files*0.85):]
|
91 |
|
92 |
+
for file in files:
|
93 |
+
yield idx, {
|
94 |
"image_file_path": file,
|
95 |
"image": file,
|
96 |
"labels": label,
|
97 |
}
|
98 |
+
idx += 1
|
99 |
+
|
100 |
|