Переглянути джерело

Add files with image_shape added as a file_attribute in VIA

sfmig 1 рік тому
батько
коміт
88ef61cd0a

+ 3 - 1
files-registry.txt

@@ -1,4 +1,4 @@
-README.md 4cafa4a8e87200e12bf4dfdd09d7173f2522a4738d66fc495ff217afae6a7e0a
+README.md 08f406680f4aa50c722b90738590c7d8f2fc64bb7bb29fa09ccade3dc4c231f1
 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
@@ -21,3 +21,5 @@ test_annotations/small_bboxes_dataset_subset/small_bboxes_VIA_subset.json 29b776
 test_annotations/small_bboxes_dataset_subset/small_bboxes_VIA_subset_plus.json a1bf2139a98cb1a9ff7fd10b2ce7746396e34c474af4ccf219f4350bf08c6e21
 test_annotations/small_bboxes_image_id_checks/small_bboxes_image_id_COCO.json 4608ccde2cb145f0c900ff82dec1b2cfadfb4645833d10238a30798601876c93
 test_annotations/small_bboxes_image_id_checks/small_bboxes_image_id_VIA.json b26c13b8578fca25c60f50c900b3e0b5705aa3c17daa0d8cfe30e2d325ad87de
+test_annotations/small_bboxes_image_shape/small_bboxes_image_shape_COCO.json 95a3d68cbd8b170f616ff39c0a4009522bef51e6d654fd7b7f05251da64b30f3
+test_annotations/small_bboxes_image_shape/small_bboxes_image_shape_VIA.json 218dd2693f722489e0cfb50d7e9368e7a2ed1cfe3ef6c706ed798f2d68f41f96

+ 9 - 0
test_data/README.md

@@ -83,6 +83,15 @@ Small size bounding boxes datasets with errors to catch.
 | `small_bboxes_non_unique_img_id_COCO.json` | bboxes | COCO | 4 | 4 | Two images have the same image ID and their filename differs only by the extension. This happens if two images have the same number-based filename, because the imageID is extracted using [`parseInt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt) when exporting as COCO in the VIA tool.|
 
 
+#### `small_bboxes_image_shape`
+
+Small size bounding boxes datasets with image shape data as exported by the VIA tool. The image width and height are stored as "file_attributes" in the VIA file.
+
+| File name | Type | Format | N annotations | N images | Comments |
+| --- | --- | --- | --- | --- | --- |
+| `small_bboxes_image_shape_COCO.json` | bboxes | COCO | 3 | 3 | One annotation per image. The image shape is stored as an integer in the exported JSON file. |
+| `small_bboxes_image_shape_VIA.json` | bboxes | VIA | 3 | 3 | One annotation per image. The image shape is stored as a string in the exported JSON file. |
+
 #### `sample_external_COCO_files`
 
 COCO files not exported from the VIA tool.

+ 1 - 0
test_data/test_annotations/small_bboxes_image_shape/small_bboxes_image_shape_COCO.json

@@ -0,0 +1 @@
+{"info":{"year":2025,"version":"1.0","description":"VIA project exported to COCO format using VGG Image Annotator (http://www.robots.ox.ac.uk/~vgg/software/via/)","contributor":"","url":"http://www.robots.ox.ac.uk/~vgg/software/via/","date_created":"Wed Sep 10 2025 12:50:08 GMT+0100 (British Summer Time)"},"images":[{"id":0,"width":1280,"height":720,"file_name":"00000.jpg","license":0,"date_captured":""},{"id":83,"width":1280,"height":720,"file_name":"00083.jpg","license":0,"date_captured":""},{"id":166,"width":1280,"height":720,"file_name":"00166.jpg","license":0,"date_captured":""}],"annotations":[{"segmentation":[[959,266,1246,266,1246,449,959,449]],"area":52521,"bbox":[959,266,287,183],"iscrowd":0,"id":1,"image_id":0,"category_id":1},{"segmentation":[[398,296,682,296,682,460,398,460]],"area":46576,"bbox":[398,296,284,164],"iscrowd":0,"id":2,"image_id":83,"category_id":1},{"segmentation":[[473,320,756,320,756,476,473,476]],"area":44148,"bbox":[473,320,283,156],"iscrowd":0,"id":3,"image_id":166,"category_id":1}],"licenses":[{"id":0,"name":"Unknown License","url":""}],"categories":[{"supercategory":"animal","id":1,"name":"crab"}]}

+ 1 - 0
test_data/test_annotations/small_bboxes_image_shape/small_bboxes_image_shape_VIA.json

@@ -0,0 +1 @@
+{"_via_settings":{"ui":{"annotation_editor_height":25,"annotation_editor_fontsize":0.8,"leftsidebar_width":18,"image_grid":{"img_height":80,"rshape_fill":"none","rshape_fill_opacity":0.3,"rshape_stroke":"yellow","rshape_stroke_width":2,"show_region_shape":true,"show_image_policy":"all"},"image":{"region_label":"__via_region_id__","region_color":"__via_default_region_color__","region_label_font":"10px Sans","on_image_annotation_editor_placement":"NEAR_REGION"}},"core":{"buffer_size":18,"filepath":{},"default_filepath":""},"project":{"name":"via_project_10Sep2025_12h46m"}},"_via_img_metadata":{"00000.jpg322877":{"filename":"00000.jpg","size":322877,"regions":[{"shape_attributes":{"name":"rect","x":959,"y":266,"width":287,"height":183},"region_attributes":{"animal":"1"}}],"file_attributes":{"width":"1280","height":"720"}},"00083.jpg311221":{"filename":"00083.jpg","size":311221,"regions":[{"shape_attributes":{"name":"rect","x":398,"y":296,"width":284,"height":164},"region_attributes":{"animal":"1"}}],"file_attributes":{"width":"1280","height":"720"}},"00166.jpg324555":{"filename":"00166.jpg","size":324555,"regions":[{"shape_attributes":{"name":"rect","x":473,"y":320,"width":283,"height":156},"region_attributes":{"animal":"1"}}],"file_attributes":{"width":"1280","height":"720"}}},"_via_attributes":{"region":{"animal":{"type":"dropdown","description":"","options":{"1":"crab"},"default_options":{"1":true}}},"file":{"width":{"type":"dropdown","description":"","options":{"1280":""},"default_options":{"1280":true}},"height":{"type":"dropdown","description":"","options":{"720":""},"default_options":{"720":true}}}},"_via_data_format_version":"2.0.10","_via_image_id_list":["00000.jpg322877","00083.jpg311221","00166.jpg324555"]}