update dataset for dataset viewer
Browse files
glenda.py
CHANGED
|
@@ -169,6 +169,11 @@ class GLENDA(datasets.GeneratorBasedBuilder):
|
|
| 169 |
elif self.config.name == "object_detection":
|
| 170 |
label_name = "objects"
|
| 171 |
annotation_list = []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
|
| 173 |
for annotation, metadata in zip(
|
| 174 |
coco_annotations["annotations"],
|
|
@@ -212,6 +217,10 @@ class GLENDA(datasets.GeneratorBasedBuilder):
|
|
| 212 |
"id": annotation["category_id"],
|
| 213 |
})
|
| 214 |
elif self.config.name == "instance_segmentation":
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
raise ValueError(annotation)
|
| 216 |
raise NotImplementedError()
|
| 217 |
else:
|
|
@@ -254,7 +263,7 @@ class GLENDA(datasets.GeneratorBasedBuilder):
|
|
| 254 |
"Could not get metadata for: ",
|
| 255 |
image_filename_with_parent_folder,
|
| 256 |
)
|
| 257 |
-
|
| 258 |
|
| 259 |
metadata.update(
|
| 260 |
{
|
|
|
|
| 169 |
elif self.config.name == "object_detection":
|
| 170 |
label_name = "objects"
|
| 171 |
annotation_list = []
|
| 172 |
+
elif self.config.name == "instance_segmentation":
|
| 173 |
+
label_name = "segmentation"
|
| 174 |
+
annotation_list = []
|
| 175 |
+
else:
|
| 176 |
+
raise NotImplementedError(f"Unsupported task: '{self.config.name}'")
|
| 177 |
|
| 178 |
for annotation, metadata in zip(
|
| 179 |
coco_annotations["annotations"],
|
|
|
|
| 217 |
"id": annotation["category_id"],
|
| 218 |
})
|
| 219 |
elif self.config.name == "instance_segmentation":
|
| 220 |
+
annotation_list.append({
|
| 221 |
+
|
| 222 |
+
})
|
| 223 |
+
raise ValueError(annotation["category_id"], annotation["segmentation"])
|
| 224 |
raise ValueError(annotation)
|
| 225 |
raise NotImplementedError()
|
| 226 |
else:
|
|
|
|
| 263 |
"Could not get metadata for: ",
|
| 264 |
image_filename_with_parent_folder,
|
| 265 |
)
|
| 266 |
+
continue
|
| 267 |
|
| 268 |
metadata.update(
|
| 269 |
{
|