文件解析
参考github:https://github.com/cocodataset/panopticapi
输入图像:
标注图像png:
标注json文件(里面有两张图):
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
{"info": {"description": "COCO 2018 Panoptic Dataset", "url": "http://cocodataset.org", "version": "1.0", "year": 2018, "contributor": "https://arxiv.org/abs/1801.00868", "date_created": "2018-06-01 00:00:00.0"}, "licenses": [{"url": "http://creativecommons.org/licenses/by-nc-sa/2.0/", "id": 1, "name": "Attribution-NonCommercial-ShareAlike License"}, {"url": "http://creativecommons.org/licenses/by-nc/2.0/", "id": 2, "name": "Attribution-NonCommercial License"}, {"url": "http://creativecommons.org/licenses/by-nc-nd/2.0/", "id": 3, "name": "Attribution-NonCommercial-NoDerivs License"}, {"url": "http://creativecommons.org/licenses/by/2.0/", "id": 4, "name": "Attribution License"}, {"url": "http://creativecommons.org/licenses/by-sa/2.0/", "id": 5, "name": "Attribution-ShareAlike License"}, {"url": "http://creativecommons.org/licenses/by-nd/2.0/", "id": 6, "name": "Attribution-NoDerivs License"}, {"url": "http://flickr.com/commons/usage/", "id": 7, "name": "No known copyright restrictions"}, {"url": "http://www.usa.gov/copyright.shtml", "id": 8, "name": "United States Government Work"}], "images": [{"license": 2, "file_name": "000000142238.jpg", "coco_url": "http://images.cocodataset.org/val2017/000000142238.jpg", "height": 427, "width": 640, "date_captured": "2013-11-20 16:47:35", "flickr_url": "http://farm5.staticflickr.com/4028/5079131149_dde584ed79_z.jpg", "id": 142238}, {"license": 1, "file_name": "000000439180.jpg", "coco_url": "http://images.cocodataset.org/val2017/000000439180.jpg", "height": 360, "width": 640, "date_captured": "2013-11-19 01:25:39", "flickr_url": "http://farm3.staticflickr.com/2831/9275116980_1d9b986e3b_z.jpg", "id": 439180}], "annotations": [{"segments_info": [{"area": 3528, "category_id": 1, "iscrowd": 0, "id": 3937500, "bbox": [282, 207, 48, 149]}, {"area": 3751, "category_id": 1, "iscrowd": 0, "id": 4260062, "bbox": [420, 183, 49, 173]}, {"area": 2301, "category_id": 1, "iscrowd": 0, "id": 2035955, "bbox": [271, 118, 53, 141]}, {"area": 4076, "category_id": 1, "iscrowd": 0, "id": 4325578, "bbox": [337, 208, 54, 149]}, {"area": 2931, "category_id": 1, "iscrowd": 0, "id": 2628072, "bbox": [47, 221, 36, 138]}, {"area": 2969, "category_id": 1, "iscrowd": 0, "id": 2822390, "bbox": [436, 125, 70, 151]}, {"area": 3557, "category_id": 1, "iscrowd": 0, "id": 5186532, "bbox": [241, 183, 45, 171]}, {"area": 477, "category_id": 1, "iscrowd": 0, "id": 4917453, "bbox": [618, 248, 22, 68]}, {"area": 3968, "category_id": 1, "iscrowd": 0, "id": 3476419, "bbox": [470, 211, 63, 142]}, {"area": 153, "category_id": 1, "iscrowd": 0, "id": 3997935, "bbox": [0, 242, 9, 44]}, {"area": 3330, "category_id": 1, "iscrowd": 0, "id": 2098642, "bbox": [153, 217, 58, 140]}, {"area": 355, "category_id": 1, "iscrowd": 0, "id": 5314498, "bbox": [586, 229, 13, 39]}, {"area": 636, "category_id": 1, "iscrowd": 0, "id": 4721614, "bbox": [270, 124, 26, 61]}, {"area": 24295, "category_id": 1, "iscrowd": 1, "id": 3153362, "bbox": [75, 111, 517, 262]}, {"area": 175, "category_id": 37, "iscrowd": 0, "id": 16757838, "bbox": [360, 116, 16, 17]}, {"area": 130762, "category_id": 184, "iscrowd": 0, "id": 2330219, "bbox": [0, 0, 640, 263]}, {"area": 8204, "category_id": 187, "iscrowd": 0, "id": 11829830, "bbox": [440, 0, 200, 103]}, {"area": 75100, "category_id": 193, "iscrowd": 0, "id": 10025880, "bbox": [0, 241, 640, 186]}], "file_name": "000000142238.png", "image_id": 142238}, {"segments_info": [{"area": 3512, "category_id": 1, "iscrowd": 0, "id": 3937500, "bbox": [200, 160, 53, 140]}, {"area": 797, "category_id": 1, "iscrowd": 0, "id": 2823390, "bbox": [520, 160, 43, 77]}, {"area": 538, "category_id": 1, "iscrowd": 0, "id": 5768384, "bbox": [0, 205, 13, 63]}, {"area": 2282, "category_id": 1, "iscrowd": 0, "id": 2626802, "bbox": [339, 151, 52, 70]}, {"area": 1005, "category_id": 1, "iscrowd": 0, "id": 3870421, "bbox": [164, 160, 36, 44]}, {"area": 2493, "category_id": 1, "iscrowd": 0, "id": 5119213, "bbox": [270, 153, 71, 113]}, {"area": 1250, "category_id": 1, "iscrowd": 0, "id": 3604684, "bbox": [577, 141, 38, 79]}, {"area": 2955, "category_id": 1, "iscrowd": 0, "id": 4070338, "bbox": [388, 147, 84, 124]}, {"area": 496, "category_id": 1, "iscrowd": 0, "id": 5777861, "bbox": [255, 172, 24, 48]}, {"area": 1521, "category_id": 1, "iscrowd": 0, "id": 3608258, "bbox": [470, 150, 48, 92]}, {"area": 2202, "category_id": 1, "iscrowd": 0, "id": 4725734, "bbox": [87, 163, 71, 116]}, {"area": 1222, "category_id": 1, "iscrowd": 0, "id": 4858845, "bbox": [233, 173, 35, 90]}, {"area": 672, "category_id": 1, "iscrowd": 0, "id": 4596217, "bbox": [16, 205, 19, 63]}, {"area": 7839, "category_id": 1, "iscrowd": 1, "id": 5120499, "bbox": [272, 142, 368, 178]}, {"area": 1680, "category_id": 8, "iscrowd": 0, "id": 4587520, "bbox": [187, 145, 86, 49]}, {"area": 5791, "category_id":