Browse Source

Add example files for COCO and VIA without supercategory

sfmig 1 năm trước cách đây
mục cha
commit
d45e48edf4

+ 5 - 1
files-registry.txt

@@ -1,4 +1,6 @@
-README.md 74a064a1fd65feb96ccc549187e668a489c2fc2a59b643ac7e154de2a2a21114
+.DS_Store 0813f29a5542d8c38bba5c21467f0c984a4652c169238653d82d3f5d3cf36029
+README.md 1b4630dd918df48977a50213d4ba3ae01f19489ef83b1795f2c9e41db992f513
+test_annotations/.DS_Store 78563a85181165a1b9d5ef069e6b0857a796f0cd5f64e441b5bf3220b14aec14
 test_annotations/medium_bboxes_dataset_COCO/COCO_JSON_sample_1.json 8bdea1ed408aaf6ad5eb8deed2f47c16fcff35697ad4983f59afb7462de9c5df
 test_annotations/medium_bboxes_dataset_COCO/COCO_JSON_sample_2.json 7ea3d6d152921294e0ab71740249c87eb5aecbb95a2b6554ab3e89a1d4e59b82
 test_annotations/medium_bboxes_dataset_VIA/VIA_JSON_sample_1.json 3d197d8fbd6121a32d729486c7511eb6d8451371a67fbae791a2309f27c8fb19
@@ -10,6 +12,8 @@ test_annotations/small_bboxes_dataset_duplicates/small_bboxes_duplicates_VIA.jso
 test_annotations/small_bboxes_dataset_errors/small_bboxes_non_unique_img_id_COCO.json 8615bdf983e06aa18dc99c31734f7990923e42abb465b27ab61f66ef77bcd2fb
 test_annotations/small_bboxes_dataset_no_categories/small_bboxes_no_cat_COCO.json 56bb5934e3552a76dd512948d6e4b0ff93037d92b67549a571f10b1b597c2b7d
 test_annotations/small_bboxes_dataset_no_categories/small_bboxes_no_cat_VIA.json 4187c3a265aecd42010b77f6d09db68ea2369c20e2ab336877c079de990b0e14
+test_annotations/small_bboxes_dataset_no_categories/small_bboxes_no_supercat_COCO.json 2dc84dad6fea3ee4ff3d97a41d65f4b21798ee0275e0762a6aa414037c846160
+test_annotations/small_bboxes_dataset_no_categories/small_bboxes_no_supercat_VIA.json de95a39102385f39cf4861b4ba566486609c173917ef6d027f167ef1d5a51d7e
 test_annotations/small_bboxes_dataset_no_categories/small_bboxes_null_catID_COCO.json 3e34ba1cfd6e176f96aeffe2d3dbe44ee4326c2368fb1c8beb7e1cdd069c7386
 test_annotations/small_bboxes_dataset_subset/small_bboxes_COCO_subset.json 63a5b2cbdf5929dfdf69b50b89635b7198904591c4b69a8d3aa48cfad7227de2
 test_annotations/small_bboxes_dataset_subset/small_bboxes_COCO_subset_plus.json 7dad577c1b0dac454ec6071994715a320286f5128fd5ef8816dacea4a73b6c75

+ 2 - 0
test_data/README.md

@@ -49,6 +49,8 @@ A small size bounding boxes dataset in VIA, COCO and VIA-CSV formats without cat
 | `small_bboxes_no_cat_VIA.json` | bboxes | VIA | 3 | 3 | No categories or supercategories are specified. This data is still supported |
 | `small_bboxes_no_cat_COCO.json` | bboxes | COCO | 3 | 3 |  No categories are specified, so no annotations are exported in COCO format. This data should throw an error. |
 | `small_bboxes_null_catID_COCO.json` | bboxes | COCO | 3 | 3 | The category ID in the VIA tool is not an integer, so when exporting the annotations to COCO format the category ID is set to `null`. This data should throw an error. |
+| `small_bboxes_no_supercat_VIA.json` | bboxes | VIA | 3 | 3 | A category (`crab`) is specified, but supercategory is set to `" "` (whitespace). This file is supported |
+| `small_bboxes_no_supercat_COCO.json` | bboxes | COCO | 3 | 3 |  A category (`crab`) is specified, but no supercategories. This data is supported. |
 
 #### `small_bboxes_dataset_subset`
 

+ 126 - 0
test_data/test_annotations/small_bboxes_dataset_no_categories/small_bboxes_no_supercat_COCO.json

@@ -0,0 +1,126 @@
+{
+    "annotations": [
+        {
+            "area": 51944,
+            "bbox": [
+                963,
+                283,
+                302,
+                172
+            ],
+            "category_id": 1,
+            "id": 1,
+            "image_id": 0,
+            "iscrowd": 0,
+            "segmentation": [
+                [
+                    963,
+                    283,
+                    1265,
+                    283,
+                    1265,
+                    455,
+                    963,
+                    455
+                ]
+            ]
+        },
+        {
+            "area": 37023,
+            "bbox": [
+                376,
+                314,
+                301,
+                123
+            ],
+            "category_id": 1,
+            "id": 2,
+            "image_id": 83,
+            "iscrowd": 0,
+            "segmentation": [
+                [
+                    376,
+                    314,
+                    677,
+                    314,
+                    677,
+                    437,
+                    376,
+                    437
+                ]
+            ]
+        },
+        {
+            "area": 39431,
+            "bbox": [
+                458,
+                329,
+                301,
+                131
+            ],
+            "category_id": 1,
+            "id": 3,
+            "image_id": 166,
+            "iscrowd": 0,
+            "segmentation": [
+                [
+                    458,
+                    329,
+                    759,
+                    329,
+                    759,
+                    460,
+                    458,
+                    460
+                ]
+            ]
+        }
+    ],
+    "categories": [
+        {
+            "id": 1,
+            "name": "crab"
+        }
+    ],
+    "images": [
+        {
+            "date_captured": "",
+            "file_name": "00000.jpg",
+            "height": 720,
+            "id": 0,
+            "license": 0,
+            "width": 1280
+        },
+        {
+            "date_captured": "",
+            "file_name": "00083.jpg",
+            "height": 720,
+            "id": 83,
+            "license": 0,
+            "width": 1280
+        },
+        {
+            "date_captured": "",
+            "file_name": "00166.jpg",
+            "height": 720,
+            "id": 166,
+            "license": 0,
+            "width": 1280
+        }
+    ],
+    "info": {
+        "contributor": "",
+        "date_created": "Thu Jan 30 2025 15:16:24 GMT+0000 (Greenwich Mean Time)",
+        "description": "VIA project exported to COCO format using VGG Image Annotator (http://www.robots.ox.ac.uk/~vgg/software/via/)",
+        "url": "http://www.robots.ox.ac.uk/~vgg/software/via/",
+        "version": "1.0",
+        "year": 2025
+    },
+    "licenses": [
+        {
+            "id": 0,
+            "name": "Unknown License",
+            "url": ""
+        }
+    ]
+}

+ 112 - 0
test_data/test_annotations/small_bboxes_dataset_no_categories/small_bboxes_no_supercat_VIA.json

@@ -0,0 +1,112 @@
+{
+    "_via_attributes": {
+        "file": {},
+        "region": {
+            " ": {
+                "default_options": {
+                    "1": true
+                },
+                "description": "",
+                "options": {
+                    "1": "crab"
+                },
+                "type": "dropdown"
+            }
+        }
+    },
+    "_via_data_format_version": "2.0.10",
+    "_via_image_id_list": [
+        "00000.jpg322877",
+        "00083.jpg311221",
+        "00166.jpg324555"
+    ],
+    "_via_img_metadata": {
+        "00000.jpg322877": {
+            "file_attributes": {},
+            "filename": "00000.jpg",
+            "regions": [
+                {
+                    "region_attributes": {
+                        " ": "1"
+                    },
+                    "shape_attributes": {
+                        "height": 172,
+                        "name": "rect",
+                        "width": 302,
+                        "x": 963,
+                        "y": 283
+                    }
+                }
+            ],
+            "size": 322877
+        },
+        "00083.jpg311221": {
+            "file_attributes": {},
+            "filename": "00083.jpg",
+            "regions": [
+                {
+                    "region_attributes": {
+                        " ": "1"
+                    },
+                    "shape_attributes": {
+                        "height": 123,
+                        "name": "rect",
+                        "width": 301,
+                        "x": 376,
+                        "y": 314
+                    }
+                }
+            ],
+            "size": 311221
+        },
+        "00166.jpg324555": {
+            "file_attributes": {},
+            "filename": "00166.jpg",
+            "regions": [
+                {
+                    "region_attributes": {
+                        " ": "1"
+                    },
+                    "shape_attributes": {
+                        "height": 131,
+                        "name": "rect",
+                        "width": 301,
+                        "x": 458,
+                        "y": 329
+                    }
+                }
+            ],
+            "size": 324555
+        }
+    },
+    "_via_settings": {
+        "core": {
+            "buffer_size": 18,
+            "default_filepath": "",
+            "filepath": {}
+        },
+        "project": {
+            "name": "via_project_30Jan2025_15h15m"
+        },
+        "ui": {
+            "annotation_editor_fontsize": 0.8,
+            "annotation_editor_height": 25,
+            "image": {
+                "on_image_annotation_editor_placement": "NEAR_REGION",
+                "region_color": "__via_default_region_color__",
+                "region_label": "__via_region_id__",
+                "region_label_font": "10px Sans"
+            },
+            "image_grid": {
+                "img_height": 80,
+                "rshape_fill": "none",
+                "rshape_fill_opacity": 0.3,
+                "rshape_stroke": "yellow",
+                "rshape_stroke_width": 2,
+                "show_image_policy": "all",
+                "show_region_shape": true
+            },
+            "leftsidebar_width": 18
+        }
+    }
+}