我想创建一个对象检测神经网络,从一些具有特殊形状的特殊项目和有限 相对较小图像数据集。为此我使用了labelme 由于对象的形状,我认为多边形标签比普通的拳击标签表现更好。 我想使用一个来自 coco Tensorflow 检测模型的预训练模型,但我努力从 json 文件创建 tfrecord 文件。正如您在下面看到的,它包括多边形和圆形 shape_type。提前感谢您的帮助。 如果您知道如何将它转换为 tfrecord 或一些替代的标记程序,这些程序可以更好地解决我的问题,请告诉我,如果它解决了我的问题,我会重新标记我的图像。 json 文件例如:
{
"version": "3.5.0",
"flags": {},
"shapes": [
{
"label": "polygon",
"line_color": null,
"fill_color": null,
"points": [
[
447,
110
],
[
491,
63
],
[
531,
47
],
[
559,
79
],
[
544,
121
],
[
532,
128
],
[
536,
139
],
[
516,
148
],
[
497,
174
]
],
"shape_type": "polygon"
},
{
"label": "circle",
"line_color": null,
"fill_color": null,
"points": [
[
403,
317
],
[
377,
262
]
],
"shape_type": "circle"
}
],
"lineColor": [
0,
255,
0,
128
],
"fillColor": [
255,
0,
0,
128
],
"imagePath": "teszt.jpg",
imageData ...(long data)
请您参考如下方法:
从 JSON 文件的外观来看,我相信您正在进行实例分割。 您可以使用 labelme 示例目录中提供的脚本。
Instance Segmentation folder有两个脚本 labelme2coco.py 和 labelme2voc.py
因此您可以将 labelme JSON 转换为 COCO 格式或 VOC 格式,并使用它们构建 TFRecords
tensorflow models repo有一堆脚本可以帮助你做到这一点
