【发布时间】:2019-09-10 22:20:45
【问题描述】:
问题
我想训练一个 MRCNN 以使用预训练的 COCO 权重检测 2 个新类别(底部、碗)。我已经在 VGG Image Annotator 中屏蔽了大约 400 张图像,但我无法加载。我认为我创建的类和多边形存在问题,但因为有超过 400 张图像,我真的不想从头开始。
基本上我使用的是 Matterport 的代码 https://github.com/matterport/Mask_RCNN
错误
在读取包含类和多边形的 .json 文件时出现错误:
Traceback (most recent call last):
File ".\Test.py", line 302, in <module>
train(model)
File ".\Test.py", line 170, in train
dataset_train.load_meooow(args.dataset, "train")
File ".\Test.py", line 115, in load_meooow
num_ids = [int(n['class']) for n in objects]
File ".\Test.py", line 115, in <listcomp>
num_ids = [int(n['class']) for n in objects]
ValueError: invalid literal for int() with base 10: 'bottom'
我了解,脚本试图将“底部”转换为非法的 int,这就是我遇到该错误的原因。
我认为我的面具有问题,但因为有很多,我希望我能做点什么......
对我来说,.json 文件结构似乎存在一些问题,但我看不出有什么问题。
图像的多边形示例
其中一张图片的多边形下方(2 类)
3D_3_14 (4).jpg2371607":{"fileref":"","size":2371607,"filename":"3D_3_14 (4).jpg","base64_img_data":"","file_attributes":{},"regions":{"0":{"shape_attributes":{"name":"polygon","all_points_x":[11,40,200,370,616,761,823,996,1268,1399,1565,1672,1818,1847,2078,2231,2379,2455,2468,2585,2583,7,11],"all_points_y":[1093,1053,984,942,929,916,1002,1022,1009,1058,1051,1049,969,909,918,949,973,1000,1033,1035,1940,1938,1093]},"region_attributes":{"class":"bottom"}},"1":{"shape_attributes":{"name":"polygon","all_points_x":[4,2590,2585,2463,2448,2319,2137,1982,1838,1849,1825,1818,1639,1428,1160,956,867,718,632,576,639,676,714,756,448,297,131,11,4],"all_points_y":[9,9,1035,1038,993,958,925,916,909,827,778,698,552,463,390,341,346,401,486,572,705,774,856,914,933,958,1009,1071,9]},"region_attributes":{"class":"bowl"}}}}
屏蔽...
在屏蔽期间,有时我会更改课程顺序。我的意思是有时班级底部是 1 级,而碗是 2 级
1 bottom
2 bowl
有时碗是 1 级,底部是 2 级
1 bowl
2 bottom
当有东西覆盖类碗时,我不得不将它分成 2 个多边形,但名称相同。所以我有 VGG 1 底部,2 碗,3 碗。
1 bottom
2 bowl
3 bowl
这可能是个问题,或者只要我坚持使用正确的多边形标签就可以了吗?
标签
我不能使用诸如 rcnn、mrcnn、mask-rcnn 之类的标签,因为它需要至少 1500 名声望。抱歉...
【问题讨论】:
标签: python json neural-network conv-neural-network