是否有任何解决方案可以从蒙版图像生成带注释的数据(如 JSON)? (对于 Mask R-CNN)

Is there any solution to generate annotated datas(like JSON) from mask image? (For Mask R-CNN)

我是深度学习新手。虽然我刚刚尝试了 Mask R-CNN(https://github.com/matterport/Mask_RCNN.git)。 我从 jupyter notebook 成功 运行 它,我尝试 运行 使用其他数据,例如面部数据。

但是我找不到带标注的人脸数据,只找到了MASK IMAGE(From CelebA dataset)。

Example of Mask Image

有没有办法从这样的图像生成注释(JSON)文件?

看看这个:https://github.com/cocodataset/cocoapi/issues/250

from imantics import Mask, Image, Category

image = Image.from_path('path/to/image.png')
image.add(Mask(array), category=Category("Category Name"))

# JSON of coco
coco_json = image.export(style='coco')
# Saves to file
image.save('coco/annotation.json', style='coco')

要求:

pip install imantics