Update SSL4EO-L-Benchmark.py
Browse files- SSL4EO-L-Benchmark.py +7 -4
SSL4EO-L-Benchmark.py
CHANGED
|
@@ -66,16 +66,19 @@ class SSL4EOLBenchmarkDataset(datasets.GeneratorBasedBuilder):
|
|
| 66 |
|
| 67 |
spatial_resolution = 30
|
| 68 |
|
| 69 |
-
BUILDER_CONFIGS = [
|
|
|
|
|
|
|
|
|
|
| 70 |
|
| 71 |
DEFAULT_CONFIG_NAME = "oli_tirs_toa_nlcd"
|
| 72 |
|
| 73 |
def __init__(self, *args, **kwargs):
|
| 74 |
name = kwargs.get('config_name', None)
|
| 75 |
print(f"config_name: {name}")
|
| 76 |
-
self.NUM_CLASSES = num_classes[name] if name else num_classes['oli_tirs_toa_nlcd']
|
| 77 |
-
self.NUM_CHANNELS = num_channels[name] if name else num_channels['oli_tirs_toa_nlcd']
|
| 78 |
-
self.metadata = metadata[name] if name else metadata['oli_tirs_toa_nlcd']
|
| 79 |
|
| 80 |
product = name.split('_')[-1]
|
| 81 |
cmap = CMAPS[product]
|
|
|
|
| 66 |
|
| 67 |
spatial_resolution = 30
|
| 68 |
|
| 69 |
+
BUILDER_CONFIGS = [
|
| 70 |
+
datasets.BuilderConfig(name="default"),
|
| 71 |
+
*[datasets.BuilderConfig(name=name) for name in subset_names]
|
| 72 |
+
]
|
| 73 |
|
| 74 |
DEFAULT_CONFIG_NAME = "oli_tirs_toa_nlcd"
|
| 75 |
|
| 76 |
def __init__(self, *args, **kwargs):
|
| 77 |
name = kwargs.get('config_name', None)
|
| 78 |
print(f"config_name: {name}")
|
| 79 |
+
self.NUM_CLASSES = num_classes[name] if name and name != "default" else num_classes['oli_tirs_toa_nlcd']
|
| 80 |
+
self.NUM_CHANNELS = num_channels[name] if name and name != "default" else num_channels['oli_tirs_toa_nlcd']
|
| 81 |
+
self.metadata = metadata[name] if name and name != "default" else metadata['oli_tirs_toa_nlcd']
|
| 82 |
|
| 83 |
product = name.split('_')[-1]
|
| 84 |
cmap = CMAPS[product]
|