Update renovation.py
Browse files- renovation.py +3 -2
renovation.py
CHANGED
@@ -81,6 +81,7 @@ class Renovations(datasets.GeneratorBasedBuilder):
|
|
81 |
files = glob.glob(path + '/*.jpeg', recursive=True)
|
82 |
all_files_and_labels.extend((file, label) for file in files)
|
83 |
|
|
|
84 |
random.shuffle(all_files_and_labels)
|
85 |
|
86 |
num_files = len(all_files_and_labels)
|
@@ -97,8 +98,8 @@ class Renovations(datasets.GeneratorBasedBuilder):
|
|
97 |
"image_file_path": file,
|
98 |
"image": file,
|
99 |
"labels": label,
|
100 |
-
|
101 |
-
|
102 |
|
103 |
|
104 |
|
|
|
81 |
files = glob.glob(path + '/*.jpeg', recursive=True)
|
82 |
all_files_and_labels.extend((file, label) for file in files)
|
83 |
|
84 |
+
random.seed(42) # ensure reproducibility
|
85 |
random.shuffle(all_files_and_labels)
|
86 |
|
87 |
num_files = len(all_files_and_labels)
|
|
|
98 |
"image_file_path": file,
|
99 |
"image": file,
|
100 |
"labels": label,
|
101 |
+
}
|
102 |
+
|
103 |
|
104 |
|
105 |
|