Upload EuroSAT.py with huggingface_hub
Browse files- EuroSAT.py +12 -12
EuroSAT.py
CHANGED
|
@@ -49,18 +49,6 @@ class EuroSAT(datasets.GeneratorBasedBuilder):
|
|
| 49 |
DEFAULT_CONFIG_NAME = "default"
|
| 50 |
|
| 51 |
def __init__(self, *args, **kwargs):
|
| 52 |
-
super().__init__(*args, **kwargs)
|
| 53 |
-
if 'config' in kwargs:
|
| 54 |
-
user_config = kwargs['config']
|
| 55 |
-
if isinstance(user_config, dict):
|
| 56 |
-
for key, value in user_config.items():
|
| 57 |
-
if hasattr(self.config, key):
|
| 58 |
-
setattr(self.config, key, value)
|
| 59 |
-
else:
|
| 60 |
-
raise ValueError("check user_config, it should be a dict")
|
| 61 |
-
else:
|
| 62 |
-
raise ValueError("config is not specified in arguments")
|
| 63 |
-
|
| 64 |
self.height = 64
|
| 65 |
self.width = 64
|
| 66 |
self.num_channels = self.config.band_indices.shape[0] # TODO: check out this
|
|
@@ -77,6 +65,18 @@ class EuroSAT(datasets.GeneratorBasedBuilder):
|
|
| 77 |
"SeaLake",
|
| 78 |
]
|
| 79 |
# self.label_ids = {label: idx for idx, label in enumerate(self.labels)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
def _info(self):
|
| 82 |
return datasets.DatasetInfo(
|
|
|
|
| 49 |
DEFAULT_CONFIG_NAME = "default"
|
| 50 |
|
| 51 |
def __init__(self, *args, **kwargs):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
self.height = 64
|
| 53 |
self.width = 64
|
| 54 |
self.num_channels = self.config.band_indices.shape[0] # TODO: check out this
|
|
|
|
| 65 |
"SeaLake",
|
| 66 |
]
|
| 67 |
# self.label_ids = {label: idx for idx, label in enumerate(self.labels)}
|
| 68 |
+
if 'config' in kwargs:
|
| 69 |
+
user_config = kwargs['config']
|
| 70 |
+
if isinstance(user_config, dict):
|
| 71 |
+
for key, value in user_config.items():
|
| 72 |
+
if hasattr(self.config, key):
|
| 73 |
+
setattr(self.config, key, value)
|
| 74 |
+
else:
|
| 75 |
+
raise ValueError("check user_config, it should be a dict")
|
| 76 |
+
else:
|
| 77 |
+
raise ValueError("config is not specified in arguments")
|
| 78 |
+
|
| 79 |
+
super().__init__(*args, **kwargs)
|
| 80 |
|
| 81 |
def _info(self):
|
| 82 |
return datasets.DatasetInfo(
|