- 在此记录一下实例分割coco的annotations.json的格式
''
annotations.json,整体是一个字典:
{
"info": {"description": null,
"url": null,
"version": null,
"year": 2023,
"contributor": null,
"date_created": "2023-05-27 10:34:38.709025"},
"licenses": [{"url": null, "id": 0, "name": null}],
"images": [{"license": 0,
"url": null,
"file_name": "....jpg",
"height": 800, "width": 800,
"date_captured": null, "id": 0},
{...},
...,
{...}]
"type": "instances",
"annotations": [{"id": 0, "image_id": 0, "category_id": 1,
"segmentation": [[polygon]], "area": 57142.0,
"bbox": [246.0, 165.0, 310.0, 239.0]([x,y,width,height],即左上角的坐标+宽高), "iscrowd": 0},
{"id": 1, "image_id": 0, "category_id": 1,
"segmentation": [[polygon]], "area": 59602.0,
"bbox": [248.0, 164.0, 311.0, 238.0], "iscrowd": 0},
{...},
...,
{...}],
"categories": [{"supercategory": null, "id": 0, "name": "_background_"},
{"supercategory": null, "id": 1, "name": "cell"}]
}
''
- 保存和加载json文件
详见【Python:json常用函数,用于加载和保存json文件】load(), loads(), dump(), dumps()
文章来源地址https://www.toymoban.com/news/detail-651690.html
文章来源:https://www.toymoban.com/news/detail-651690.html
到了这里,关于【记录COCO数据集格式】实例分割的annotations.json的内部格式的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!