Semantic masks
Browse filesSigned-off-by: Jiri Podivin <[email protected]>
- .gitattributes +5 -0
- metadata_semantic_test.csv +3 -0
- metadata_semantic_train.csv +3 -0
- metadata_test.csv +0 -0
- metadata_train.csv +0 -0
- plantorgans.py +14 -9
- semantic_masks.tar.00 +3 -0
- semantic_masks.tar.01 +3 -0
.gitattributes
CHANGED
@@ -59,3 +59,8 @@ labels_raw.json filter=lfs diff=lfs merge=lfs -text
|
|
59 |
labels_test.csv filter=lfs diff=lfs merge=lfs -text
|
60 |
labels_train.csv filter=lfs diff=lfs merge=lfs -text
|
61 |
labels_raw filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
59 |
labels_test.csv filter=lfs diff=lfs merge=lfs -text
|
60 |
labels_train.csv filter=lfs diff=lfs merge=lfs -text
|
61 |
labels_raw filter=lfs diff=lfs merge=lfs -text
|
62 |
+
metadata_train.csv filter=lfs diff=lfs merge=lfs -text
|
63 |
+
metadata filter=lfs diff=lfs merge=lfs -text
|
64 |
+
metadata_semantic_test.csv filter=lfs diff=lfs merge=lfs -text
|
65 |
+
metadata_semantic_train.csv filter=lfs diff=lfs merge=lfs -text
|
66 |
+
metadata_test.csv filter=lfs diff=lfs merge=lfs -text
|
metadata_semantic_test.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a0f94ce4ddaefe6cd6881698ae9b375907a9a44ee26ee6e8b226f7fc4843e0ac
|
3 |
+
size 9839152
|
metadata_semantic_train.csv
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:dce5995456cc88209702d3e324299c99121db8f0d6819919aee8d600b5e4d47c
|
3 |
+
size 22904232
|
metadata_test.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
metadata_train.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
plantorgans.py
CHANGED
@@ -16,13 +16,18 @@ _BASE_URL = "https://huggingface.co/datasets/jpodivin/plantorgans/resolve/main/"
|
|
16 |
_TRAIN_URLS = [_BASE_URL + f"sourcedata_labeled.tar.{i:02}" for i in range(0, 8)]
|
17 |
_TEST_URLS = [_BASE_URL + f"sourcedata_labeled.tar.{i:02}" for i in range(8, 12)]
|
18 |
_MASKS_URLS = [_BASE_URL + f"masks.tar.0{i}" for i in range(0, 2)]
|
|
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
21 |
'train': 'https://huggingface.co/datasets/jpodivin/plantorgans/resolve/main/metadata_train.csv',
|
22 |
'test': 'https://huggingface.co/datasets/jpodivin/plantorgans/resolve/main/metadata_test.csv'
|
23 |
}
|
24 |
|
25 |
-
|
26 |
class PlantOrgansConfig(datasets.BuilderConfig):
|
27 |
"""Builder Config for PlantOrgans"""
|
28 |
|
@@ -47,7 +52,7 @@ class PlantOrgans(datasets.GeneratorBasedBuilder):
|
|
47 |
name="semantic_segmentation_full",
|
48 |
description="This configuration contains segmentation masks.",
|
49 |
data_url=_BASE_URL,
|
50 |
-
metadata_urls=
|
51 |
splits=['train', 'test'],
|
52 |
),
|
53 |
]
|
@@ -59,8 +64,8 @@ class PlantOrgans(datasets.GeneratorBasedBuilder):
|
|
59 |
{
|
60 |
"image": datasets.Image(),
|
61 |
"mask": datasets.Image(),
|
62 |
-
"
|
63 |
-
"
|
64 |
}
|
65 |
),
|
66 |
supervised_keys=("image", "mask"),
|
@@ -82,13 +87,13 @@ class PlantOrgans(datasets.GeneratorBasedBuilder):
|
|
82 |
train_paths.extend(glob.glob(str(p)+'/sourcedata/labeled/**.jpg'))
|
83 |
for p in test_archives_paths:
|
84 |
test_paths.extend(glob.glob(str(p)+'/sourcedata/labeled/**.jpg'))
|
85 |
-
split_metadata_paths = dl_manager.download(
|
86 |
|
87 |
-
mask_archives_paths = dl_manager.download_and_extract(
|
88 |
|
89 |
mask_paths = []
|
90 |
for p in mask_archives_paths:
|
91 |
-
mask_paths.extend(glob.glob(str(p)+'/
|
92 |
|
93 |
return [
|
94 |
datasets.SplitGenerator(
|
@@ -140,7 +145,7 @@ class PlantOrgans(datasets.GeneratorBasedBuilder):
|
|
140 |
'mask': r['mask_path'],
|
141 |
'image': r['image_path'],
|
142 |
'image_name': Path(r['image_path']).parts[-1],
|
143 |
-
'
|
144 |
}
|
145 |
|
146 |
yield i, example
|
|
|
16 |
_TRAIN_URLS = [_BASE_URL + f"sourcedata_labeled.tar.{i:02}" for i in range(0, 8)]
|
17 |
_TEST_URLS = [_BASE_URL + f"sourcedata_labeled.tar.{i:02}" for i in range(8, 12)]
|
18 |
_MASKS_URLS = [_BASE_URL + f"masks.tar.0{i}" for i in range(0, 2)]
|
19 |
+
_SEMANTIC_MASKS_URLS = [_BASE_URL + f"semantic_masks.tar.0{i}" for i in range(0, 2)]
|
20 |
|
21 |
+
_SEMANTIC_METADATA_URLS = {
|
22 |
+
'train': 'https://huggingface.co/datasets/jpodivin/plantorgans/resolve/main/metadata_semantic_train.csv',
|
23 |
+
'test': 'https://huggingface.co/datasets/jpodivin/plantorgans/resolve/main/metadata_semantic_test.csv'
|
24 |
+
}
|
25 |
+
|
26 |
+
_PANOPTIC_METADATA_URLS = {
|
27 |
'train': 'https://huggingface.co/datasets/jpodivin/plantorgans/resolve/main/metadata_train.csv',
|
28 |
'test': 'https://huggingface.co/datasets/jpodivin/plantorgans/resolve/main/metadata_test.csv'
|
29 |
}
|
30 |
|
|
|
31 |
class PlantOrgansConfig(datasets.BuilderConfig):
|
32 |
"""Builder Config for PlantOrgans"""
|
33 |
|
|
|
52 |
name="semantic_segmentation_full",
|
53 |
description="This configuration contains segmentation masks.",
|
54 |
data_url=_BASE_URL,
|
55 |
+
metadata_urls=_SEMANTIC_METADATA_URLS,
|
56 |
splits=['train', 'test'],
|
57 |
),
|
58 |
]
|
|
|
64 |
{
|
65 |
"image": datasets.Image(),
|
66 |
"mask": datasets.Image(),
|
67 |
+
"image_name": datasets.Value(dtype="string"),
|
68 |
+
"class": datasets.Value(dtype="string")
|
69 |
}
|
70 |
),
|
71 |
supervised_keys=("image", "mask"),
|
|
|
87 |
train_paths.extend(glob.glob(str(p)+'/sourcedata/labeled/**.jpg'))
|
88 |
for p in test_archives_paths:
|
89 |
test_paths.extend(glob.glob(str(p)+'/sourcedata/labeled/**.jpg'))
|
90 |
+
split_metadata_paths = dl_manager.download(_SEMANTIC_METADATA_URLS)
|
91 |
|
92 |
+
mask_archives_paths = dl_manager.download_and_extract(_SEMANTIC_MASKS_URLS)
|
93 |
|
94 |
mask_paths = []
|
95 |
for p in mask_archives_paths:
|
96 |
+
mask_paths.extend(glob.glob(str(p)+'/semantic_masks/**.png'))
|
97 |
|
98 |
return [
|
99 |
datasets.SplitGenerator(
|
|
|
145 |
'mask': r['mask_path'],
|
146 |
'image': r['image_path'],
|
147 |
'image_name': Path(r['image_path']).parts[-1],
|
148 |
+
'class': r['class']
|
149 |
}
|
150 |
|
151 |
yield i, example
|
semantic_masks.tar.00
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:41d2d9638b7f12a5284ced53e1d9a4591b11c3227476feed328ca48947b744a5
|
3 |
+
size 582758400
|
semantic_masks.tar.01
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a027e3447f65c326b972ce1c1eeec102338f411a78e5d261d7f9fce405013515
|
3 |
+
size 512757760
|