将 coco 转换为 labelme 格式

问题描述

我想把我现有的coco格式转换成labelme格式:

可可:

{"info":{"description":"my-project-name"},"images":[{"id":1,"width":3296,"height":2472,"file_name":"test.png"}],"annotations":[{"id":0,"iscrowd":0,"image_id":1,"category_id":1,"segmentation":[[1281.1870967741934,626.5437788018434,1235.6202764976958,726.7907834101383,1383.7124423963132,745.0175115207373,1547.752995391705,1595.5981566820276,624.2654377880185]],"bBox":[1235.6202764976958,624.2654377880185,359.97788018433175,120.75207373271883],"area":34552.81165112869},{"id":1,"segmentation":[[474.6543778801842,776.9142857142858,460.98433179723486,895.3880184331798,823.2405529953916,870.3262672811061,807.2921658986174,758.6875576036867]],"bBox":[460.98433179723486,758.6875576036867,362.2562211981567,136.70046082949307],"area":40000.595896281506}],"categories":[{"id":1,"name":"leaf"}]}

标签

{
  "version": "4.5.7","flags": {},"shapes": [
    {
      "label": "frame","points": [
        [
          1055.4444444444446,266.11111111111114
        ],[
          1038.7777777777778,2171.666666666667
        ],[
          1124.888888888889,2166.1111111111113
        ],[
          1144.3333333333335,343.8888888888889
        ],[
          1644.3333333333335,349.44444444444446
        ],2168.888888888889
        ],[
          1736.0,[
          1727.6666666666667,260.55555555555554
        ]
      ],"group_id": 1,"shape_type": "polygon","flags": {}
    },

我不清楚为什么 labelme 将多边形存储为点。如何将我的可可多边形列表转换为 labelme 的点多边形列表?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)