deepcam-cn / yolov5-face

YOLO5Face: Why Reinventing a Face Detector (https://arxiv.org/abs/2105.12931) ECCV Workshops 2022)
GNU General Public License v3.0
2.11k stars 501 forks source link

LebelME object and points to yolo format #217

Closed xellDart closed 2 years ago

xellDart commented 2 years ago

Hi, I'm trying to generate my own dataset using Labelme to annotate the image, but I can't understand how to transform it to this format, could you help me with this?

Current file:

{
  "version": "5.0.5",
  "flags": {},
  "shapes": [
    {
      "label": "id",
      "points": [
        [
          38.45454545454544,
          469.45454545454544
        ],
        [
          1449.818181818182,
          1405.818181818182
        ]
      ],
      "group_id": null,
      "shape_type": "rectangle",
      "flags": {}
    },
    {
      "label": "point",
      "points": [
        [
          61.181818181818244,
          553.5454545454545
        ]
      ],
      "group_id": null,
      "shape_type": "point",
      "flags": {}
    },
    {
      "label": "point",
      "points": [
        [
          1402.090909090909,
          496.7272727272727
        ]
      ],
      "group_id": null,
      "shape_type": "point",
      "flags": {}
    },
    {
      "label": "point",
      "points": [
        [
          1429.3636363636363,
          1317.1818181818182
        ]
      ],
      "group_id": null,
      "shape_type": "point",
      "flags": {}
    },
    {
      "label": "point",
      "points": [
        [
          99.81818181818187,
          1378.5454545454547
        ]
      ],
      "group_id": null,
      "shape_type": "point",
      "flags": {}
    }
  ],

The current file is for document 4 corners and document rectangle...