目录
问题描述
最近在使用ultralytics进行目标检测训练的时候,准备数据集时候,遇到了一个坑。labelme标注的json格式不能直接用来训练。
labelme格式
原始labelme标注的json格式如下:
{
"version": "5.4.1",
"flags": {},
"shapes": [
{
"label": "fire",
"points": [
[
943.5862068965517,
1849.9310344827586
],
[
1305.6551724137933,
2160.2758620689656
]
],
"group_id": null,
"description": "",
"shape_type": "rectangle",
"flags": {},
"mask": null
},
{
"label": "fire",
"points": [
[
1764.2758620689656,
1394.7586206896551
],
[
2109.103448275862,
1684.4137931034481
]
],
"group_id": null,
"description": "",
"shape_type": "rectangle",
"flags": {},
"mask": null
},
{
"label": "fire",
"points": [
[
2964.2758620689656,
722.3448275862067
],
[
32