Procházet zdrojové kódy

Add COCO file with null category

sfmig před 1 rokem
rodič
revize
cb3652f509

+ 2 - 1
files-registry.txt

@@ -1,4 +1,4 @@
-DATA_DESCRIPTION.md d93e517f6a9a663c13288c1c0986295dbd675b682e6ec8b3340985f3d65c209a
+DATA_DESCRIPTION.md 7c262076ef5b13eae12d521763a05953a8ec78634b4f28e416a2a39f7ff02275
 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
@@ -9,3 +9,4 @@ test_annotations/small_bboxes_dataset_duplicates/small_bboxes_duplicates_COCO.js
 test_annotations/small_bboxes_dataset_duplicates/small_bboxes_duplicates_VIA.json 90c0dfba401d62a168bda231709d899ee3314bd4c9ab5df6483674cf0a47585d
 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_null_catID_COCO.json 3e34ba1cfd6e176f96aeffe2d3dbe44ee4326c2368fb1c8beb7e1cdd069c7386

+ 3 - 1
test_data/DATA_DESCRIPTION.md

@@ -46,5 +46,7 @@ A small size bounding boxess dataset in VIA, COCO and VIA-CSV formats without ca
 | File name | Type | Format | N annotations | N images | Comments |
 | --- | --- | --- | --- | --- | --- |
 | `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 will throw an error. |
+| `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. |
+
 

+ 127 - 0
test_data/test_annotations/small_bboxes_dataset_no_categories/small_bboxes_null_catID_COCO.json

@@ -0,0 +1,127 @@
+{
+    "annotations": [
+        {
+            "area": 50460,
+            "bbox": [
+                945,
+                281,
+                290,
+                174
+            ],
+            "category_id": null,
+            "id": 1,
+            "image_id": 0,
+            "iscrowd": 0,
+            "segmentation": [
+                [
+                    945,
+                    281,
+                    1235,
+                    281,
+                    1235,
+                    455,
+                    945,
+                    455
+                ]
+            ]
+        },
+        {
+            "area": 70176,
+            "bbox": [
+                380,
+                300,
+                344,
+                204
+            ],
+            "category_id": null,
+            "id": 2,
+            "image_id": 83,
+            "iscrowd": 0,
+            "segmentation": [
+                [
+                    380,
+                    300,
+                    724,
+                    300,
+                    724,
+                    504,
+                    380,
+                    504
+                ]
+            ]
+        },
+        {
+            "area": 39816,
+            "bbox": [
+                498,
+                300,
+                237,
+                168
+            ],
+            "category_id": null,
+            "id": 3,
+            "image_id": 166,
+            "iscrowd": 0,
+            "segmentation": [
+                [
+                    498,
+                    300,
+                    735,
+                    300,
+                    735,
+                    468,
+                    498,
+                    468
+                ]
+            ]
+        }
+    ],
+    "categories": [
+        {
+            "id": null,
+            "name": "crab",
+            "supercategory": "animal"
+        }
+    ],
+    "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": "Mon Feb 10 2025 13:00:01 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": ""
+        }
+    ]
+}