Update BigEarthNet.py
Browse files- BigEarthNet.py +4 -2
BigEarthNet.py
CHANGED
|
@@ -122,7 +122,7 @@ S1_STD = [5.25697717, 5.91150917]
|
|
| 122 |
|
| 123 |
parts = [f"a{letter}" for letter in string.ascii_lowercase]
|
| 124 |
parts.extend([f"b{letter}" for letter in string.ascii_lowercase[:8]])
|
| 125 |
-
parts = ["aa"
|
| 126 |
|
| 127 |
class BigEarthNetDataset(datasets.GeneratorBasedBuilder):
|
| 128 |
VERSION = datasets.Version("1.0.0")
|
|
@@ -182,17 +182,19 @@ class BigEarthNetDataset(datasets.GeneratorBasedBuilder):
|
|
| 182 |
print("Downloading data files from HF")
|
| 183 |
downloaded_files = dl_manager.download(self.DATA_URL)
|
| 184 |
print("Downloading Finished")
|
|
|
|
| 185 |
combined_file = os.path.join(dl_manager.download_config.cache_dir, "combined.tar.gz")
|
| 186 |
print(f"copying files to {combined_file}")
|
| 187 |
with open(combined_file, 'wb') as outfile:
|
| 188 |
counter = 0
|
| 189 |
for part_file in downloaded_files:
|
| 190 |
-
print(f"copying {counter}-th file")
|
| 191 |
with open(part_file, 'rb') as infile:
|
| 192 |
shutil.copyfileobj(infile, outfile)
|
| 193 |
counter += 1
|
| 194 |
data_dir = dl_manager.extract(combined_file)
|
| 195 |
os.remove(combined_file)
|
|
|
|
| 196 |
except Exception as e:
|
| 197 |
# Print the error message
|
| 198 |
print(f"{e}, setting data_dir to None")
|
|
|
|
| 122 |
|
| 123 |
parts = [f"a{letter}" for letter in string.ascii_lowercase]
|
| 124 |
parts.extend([f"b{letter}" for letter in string.ascii_lowercase[:8]])
|
| 125 |
+
parts = ["aa"]
|
| 126 |
|
| 127 |
class BigEarthNetDataset(datasets.GeneratorBasedBuilder):
|
| 128 |
VERSION = datasets.Version("1.0.0")
|
|
|
|
| 182 |
print("Downloading data files from HF")
|
| 183 |
downloaded_files = dl_manager.download(self.DATA_URL)
|
| 184 |
print("Downloading Finished")
|
| 185 |
+
print(f"downloaded files: {downloaded_files}")
|
| 186 |
combined_file = os.path.join(dl_manager.download_config.cache_dir, "combined.tar.gz")
|
| 187 |
print(f"copying files to {combined_file}")
|
| 188 |
with open(combined_file, 'wb') as outfile:
|
| 189 |
counter = 0
|
| 190 |
for part_file in downloaded_files:
|
| 191 |
+
print(f"copying {counter}-th file: {part_file}")
|
| 192 |
with open(part_file, 'rb') as infile:
|
| 193 |
shutil.copyfileobj(infile, outfile)
|
| 194 |
counter += 1
|
| 195 |
data_dir = dl_manager.extract(combined_file)
|
| 196 |
os.remove(combined_file)
|
| 197 |
+
print(f"data_dir: {data_dir")
|
| 198 |
except Exception as e:
|
| 199 |
# Print the error message
|
| 200 |
print(f"{e}, setting data_dir to None")
|