如何将 labelme json 目录转换为一个 json 文件以在 MaskRCNN 中使用?
我正在尝试在 MaskRCNN 上训练一个对象分类器,我接下来的教程使用 VGG 标签软件,其中将标记数据转换为一个 JSON 文件。我已将 labelme 用于我的数据,需要为 MaskRCNN 准备此数据。
Labelme 为每个带标签的图像提供一个 JSON 文件,格式如下:
{ "version": "4.6.0", "flags": {}, "shapes": [
{
"label": "Green",
"points": [
[
1385.6666666666665,
2.121212121212121
],
[
1349.3030303030303,
174.84848484848484
],
[
1400.8181818181818,
296.06060606060606
],
[
1482.6363636363635,
344.5454545454545
],
[
1619.0,
338.48484848484844
],
[
1715.969696969697,
244.54545454545453
],
[
1728.090909090909,
120.30303030303028
],
[
1712.939393939394,
71.81818181818181
],
[
1679.6060606060605,
11.212121212121211
]
],
"group_id": null,
"shape_type": "polygon",
"flags": {}
},
我有一个图像目录和相应的 JSON 文件,以及有关如何组合的任何帮助。无法让 labelme_json_to_dataset 工作,我相信这就是解决方案?
I am attempting to train an object classifier on MaskRCNN and the tutorial I am following uses VGG label software in which converts the labelled data into one JSON file. I have used labelme for my data and need to prepare this for MaskRCNN.
Labelme gives a JSON file for each labelled image in this format:
{ "version": "4.6.0", "flags": {}, "shapes": [
{
"label": "Green",
"points": [
[
1385.6666666666665,
2.121212121212121
],
[
1349.3030303030303,
174.84848484848484
],
[
1400.8181818181818,
296.06060606060606
],
[
1482.6363636363635,
344.5454545454545
],
[
1619.0,
338.48484848484844
],
[
1715.969696969697,
244.54545454545453
],
[
1728.090909090909,
120.30303030303028
],
[
1712.939393939394,
71.81818181818181
],
[
1679.6060606060605,
11.212121212121211
]
],
"group_id": null,
"shape_type": "polygon",
"flags": {}
},
I have a directory of images and corresponding JSON files, any help on what to do to combine. Can't get labelme_json_to_dataset to work and I believe this is the solution ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在示例\instance_segmentation文件夹下的lableme存储库中使用lableme2coco.py脚本
使用此命令:
它将您的注释文件转换为 coco 格式的一个 json 文件
srcfiles 包含您的标签以及同一文件夹中的图像,而 lables.txt 包含您的标签
you can use lableme2coco.py script in lableme repository under examples\instance_segmentation folder
with this command:
it will convert your annotation files in one json file with coco format
srcfiles contains your labels with images in same folder and lables.txt contains your labels