Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mask RCNN: How to add region annotation based on manually segmented image?

There is a implementation of Mask RCNN on Github by Matterport. I'm trying to train my data for it. I'm adding polygons on images with this tool. I'm drawing polygons on images manually, but I already have manually segmented image below (black and white one)

My questions are:

1) When adding json annotation for region data, is there a way to use that pre-segmented image below?

2) Is there a way to train my data for this algorithm, without adding json annotation and use manually segmented images? The tutorials and posts I've seen uses json annotations to train.

3) This algorithm's output is image with masks obviously, is there a way get black and white output for segmentations?

Here's the code that I'm working on google colab.

Original Repo

My Fork

Original image Manually segmented image Man segmented image

like image 607
mirkancal Avatar asked May 06 '19 07:05

mirkancal


People also ask

What is image segmentation mask?

A mask is a binary image consisting of zero- and non-zero values. If a mask is applied to another binary or to a grayscale image of the same size, all pixels which are zero in the mask are set to zero in the output image.

How does mask R-CNN works?

It integrates object detection task where the goal is to detect object class along with bounding box prediction in an image and semantic segmentation task, which classifies each pixel into pre-defined categories Thus, it enables us to detect objects in an image while precisely segmenting a mask for each object instance ...


1 Answers

I think both questions 1 and 2 refer to the same solution: you need to convert your masks to json annotations. For that, I would suggest you to read this link, posted in the repository of the cocodataset. There you can read about this repository that you could use for what you need. You could also use directly the Coco PythonAPI, calling the methods here defined. For question 3, a mask is already binary image (therefore, you can show it as black and white pixels).

like image 64
maxi.marufo Avatar answered Oct 12 '22 21:10

maxi.marufo