How to make my own mask image

HI
How to make my own mask image?
The mask in CameraMask looks black.

i mean mask label image

If the given mask images in the exercise dataset don’t render properly for you in your own environment, you’re probably not handing the channel values correctly. I think the images there (both the camera images and the masks) are 4 channel PNG files (RGBA). For the masks, the label value is on the first (0-th) channel. You have to pull just that value for the rendering. Make sure to compare your rendering code to the sample code in the notebook.

As to the question of how to create the labeled mask image files for your own input images, that’s a much harder question and I don’t know the answer. You can try googling for that topic. Here’s one article I found, but I think it’s just a slightly disguised advertisement for a company which provides that service.

As Paul explained, we are using RGBA file, and using 1st channel for a segmentation mask.
To assign “color” for segmented objects, our mask uses a color index. Remember that we used “class number=23” to define our network in our assignment. This is actually equal to the range of color indexes used for a mask. If you extract the first layer of the mask, then, you will see the value in the range of 0 to 22. Then, matplotlib takes color index values, and displays 2D images.

There is a function to convert RPG to image indexes in Matlab. (sorry that it’s not Python…)

img = imread('000027.png');
[new_mask,cmap] = rgb2ind(img, 23, 'nodither');
imagesc(new_mask);

Pixel level conversion from RGB to image indexes (23 classes) can be done quickly in Matlab.
But, of course, it is not a mask that we expect. Here is the result.

Even sky, it consists of several colors. Road is as well. Historically, we need a tool to create a ground truth. I believe we still need some human interventions like this.

There are some dataset that has annotations with those.

Another bold idea is to use State-of-the-Art image segmentation network to create pseudo grand truth label. :slight_smile:

This is an interesting paper even from its title. Per-Pixel Classification is Not All You Need for Semantic Segmentation.