[英]How to define inner polygon in coco dataset?
The best solution is to define shapes with holes using RLE (Run Length Encoded) masks.最好的解决方案是使用 RLE(运行长度编码)掩码定义带孔的形状。
In the Matterport Mask R-CNN implementation, all polygonal segmentations are converted to RLE and then converted to masks.在 Matterport Mask R-CNN 实现中,所有多边形分割都转换为 RLE,然后转换为掩码。 Check out annToMask() and annToRLE() in coco.py .退房annToMask()和annToRLE()在coco.py 。 The reason for the polygons is that they're more efficient to store in json and will shrink the size of the annotation file.多边形的原因是它们在 json 中存储更有效,并且会缩小注释文件的大小。 If you can't define your shape with a solid polygon, you're stuck with a potentially larger RLE unless you want to make your own custom annotations within COCO and modify your neural net to convert those polygon holes to RLE on your own.如果你不能用实心多边形定义你的形状,你就会被一个可能更大的 RLE 卡住,除非你想在 COCO 中制作你自己的自定义注释并修改你的神经网络以自己将这些多边形孔转换为 RLE。
Note that if you are using a neural net that only finds bounding boxes, this is all unneccesary because it won't be capable of returning holes anyway.请注意,如果您使用的神经网络只能找到边界框,那么这一切都是不必要的,因为它无论如何都无法返回空洞。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.