简体   繁体   English

如何在可可数据集中定义内部多边形?

[英]How to define inner polygon in coco dataset?

I'm looking to understand how to define inner or interior polygon in segmentation part of coco dataset我想了解如何在可可数据集的分割部分定义内部或内部多边形

I'd like to teach the convolution network to recognize holes in building polygons我想教卷积网络识别构建多边形中的洞

Example of the polygon with hole带孔的多边形示例

在此处输入图片说明

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM