Datasets:
Tasks:
Image Classification
Sub-tasks:
multi-class-image-classification
Languages:
English
Size:
1K<n<10K
License:
Add logging + edit dl_manager for image-segmentation
Browse filesThis: `train_data = dl_manager.iter_files(data_files["train"]), dl_manager.iter_files(data_files["train_mask"])` for: ` train_data = dl_manager.iter_files([data_files["train"]]), dl_manager.iter_files([data_files["train_mask"]])`
`
- rock-glacier-dataset.py +6 -2
rock-glacier-dataset.py
CHANGED
@@ -19,6 +19,9 @@ import re
|
|
19 |
import datasets
|
20 |
from datasets.tasks import ImageClassification
|
21 |
|
|
|
|
|
|
|
22 |
_HOMEPAGE = "https://github.com/alcazar90/rock-glacier-detection"
|
23 |
|
24 |
|
@@ -111,7 +114,7 @@ class RockGlacierDataset(datasets.GeneratorBasedBuilder):
|
|
111 |
]
|
112 |
|
113 |
if self.config.name == "image-segmentation":
|
114 |
-
train_data = dl_manager.iter_files(data_files["train"]), dl_manager.iter_files(data_files["train_mask"])
|
115 |
return [
|
116 |
datasets.SplitGenerator(
|
117 |
name=datasets.Split.TRAIN,
|
@@ -140,7 +143,8 @@ class RockGlacierDataset(datasets.GeneratorBasedBuilder):
|
|
140 |
# iterate trought masks
|
141 |
for mask_path in masks:
|
142 |
mask_id = re.search('\d+', mask_path).group(0)
|
143 |
-
imageId2mask[mask_id] = mask_path
|
|
|
144 |
for i, path in enumerate(files):
|
145 |
file_name = os.path.basename(path)
|
146 |
if file_name.endswith(".png"):
|
|
|
19 |
import datasets
|
20 |
from datasets.tasks import ImageClassification
|
21 |
|
22 |
+
logger = datasets.logging.get_logger(__name__)
|
23 |
+
|
24 |
+
|
25 |
_HOMEPAGE = "https://github.com/alcazar90/rock-glacier-detection"
|
26 |
|
27 |
|
|
|
114 |
]
|
115 |
|
116 |
if self.config.name == "image-segmentation":
|
117 |
+
train_data = dl_manager.iter_files([data_files["train"]]), dl_manager.iter_files([data_files["train_mask"]])
|
118 |
return [
|
119 |
datasets.SplitGenerator(
|
120 |
name=datasets.Split.TRAIN,
|
|
|
143 |
# iterate trought masks
|
144 |
for mask_path in masks:
|
145 |
mask_id = re.search('\d+', mask_path).group(0)
|
146 |
+
imageId2mask[mask_id] = mask_path
|
147 |
+
logger.info(f"imageId2mask check paths: {imageId2mask}")
|
148 |
for i, path in enumerate(files):
|
149 |
file_name = os.path.basename(path)
|
150 |
if file_name.endswith(".png"):
|