Datasets:

Modalities:
Image
Languages:
English
DOI:
Libraries:
Datasets
License:
xhagrg commited on
Commit
bc202bd
·
1 Parent(s): 1d52121

Update hls_burn_scars.py

Browse files
Files changed (1) hide show
  1. hls_burn_scars.py +9 -9
hls_burn_scars.py CHANGED
@@ -83,12 +83,12 @@ class HLSBurnScars(datasets.GeneratorBasedBuilder):
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
- # }
 
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
+ }