Update hls_burn_scars.py
Browse files- hls_burn_scars.py +9 -9
hls_burn_scars.py
CHANGED
@@ -83,12 +83,12 @@ class HLSBurnScars(datasets.GeneratorBasedBuilder):
|
|
83 |
)
|
84 |
]
|
85 |
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
|
|
83 |
)
|
84 |
]
|
85 |
|
86 |
+
def _generate_examples(self, data, split):
|
87 |
+
files = glob(f"{data}/{split}/*_merged.tif")
|
88 |
+
for idx, filename in enumerate(files):
|
89 |
+
if filename.endswith("_merged.tif"):
|
90 |
+
annotation_filename = filename.replace('_merged.tif', '.mask.tif')
|
91 |
+
yield idx, {
|
92 |
+
"image": {"path": filename, "bytes": open(filename).read()},
|
93 |
+
"annotation": {"path": annotation_filename, "bytes": open(annotation_filename).read()},
|
94 |
+
}
|