Datasets:
Tasks:
Image Segmentation
ArXiv:
Upload DFC2020.py with huggingface_hub
Browse files- DFC2020.py +14 -14
DFC2020.py
CHANGED
@@ -147,17 +147,17 @@ class DFC2020Dataset(datasets.GeneratorBasedBuilder):
|
|
147 |
|
148 |
yield f"{index}", sample
|
149 |
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
147 |
|
148 |
yield f"{index}", sample
|
149 |
|
150 |
+
def _read_image(self, image_path):
|
151 |
+
"""Read tiff image from image_path
|
152 |
+
Args:
|
153 |
+
image_path:
|
154 |
+
Image path to read from
|
155 |
+
|
156 |
+
Return:
|
157 |
+
image:
|
158 |
+
C, H, W numpy array image
|
159 |
+
"""
|
160 |
+
image = tifffile.imread(image_path)
|
161 |
+
image = np.transpose(image, (2, 0, 1))
|
162 |
+
|
163 |
+
return image
|