open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
8.15k stars 2.59k forks source link

How to use mask image for mmsegmentation #559

Closed tvkarthik05 closed 3 years ago

tvkarthik05 commented 3 years ago

Hi,

This is a great package and i have been trying to explore this for one of my use case. I have a few questions,

1) I could not find any examples for images which contain mask rather than the regions.txt file and layers.txt file. Is it possible to use mask data i.e. .tif images which contain the mask for training the model i.e. something like the image given below where the mask is kept in the labels folder and the original image in the train folder?

image

2) Also in my case i have only one class, but when i try with just one class the output appears like this, image

Any help on this is highly appreciated!

MengzhangLI commented 3 years ago

Hi, sorry for late reply.

Seems like it is brain tumour semgnetation task and modality is MR. Maybe it is BraTs.

A1: You would better transform the format from .tif/.nii/.dcm to png. Right now MMSegmentation only support natural images such as png file. Please check CHASE_DB1_data_preparation_doc.

Just follow its folder orgnization and data format, and I have to mention right now the whole framework only support 2D image.

A2: Seems like your config file is not correct or your data folder is not correct, I can not judge at this time.

My suggestion is: (1) Follow default data preparation process. https://github.com/open-mmlab/mmsegmentation/blob/master/docs/dataset_prepare.md (2) Reading documents of config, customize dataset and data pipeline.

Best,