Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
771 views
in Technique[技术] by (71.8m points)

neural network - How to convert images into a dataset for semantic segmentation

I am trying to make a new semantic segmentation model that will take grainy microscopy images as input and segment them.

Input Image

Output Image

I have all the input and ground truth images in .png format, and I'm having a hard time curating them into a dataset that others can use. I've looked into some articles, but they explain how to make label images that I already have. So, is there a way/software which I can use to curate the dataset?

Thanks

question from:https://stackoverflow.com/questions/65917110/how-to-convert-images-into-a-dataset-for-semantic-segmentation

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can organize the images along similar to the organization in the VOC challenge.

That is, you should have the following directory tree:

my_dataset
   |
   +---  InputImages
   |           |
   |           +---   000.png
   |           +---   001.png
   |           +---   002.png
   |           ...
   |
   +---  SegmentationMasks
   |           |
   |           +---   000.png
   |           +---   001.png
   |           +---   002.png
   |           ...
   |  
   +---  ImageSets 
               |
               +---   train.txt
               +---   val.txt
               +---   test.txt

That is, you store all input images under InputImages folder and all the segmentation masks you have under SegmentationMasks folder. Make sure the mask SegmentationMasks/000.png corresponds to InputImages/000.png (and so on for all images and masks).

Additionally, you can have a fixed split of your dataset into "train", "validation" and "test" sets. This split is stored in the test files under ImageSets:
The file train.txt lists the image ids that are part of the train set, val.txt lists the ids of the validation set and so on.
Make sure all ids are included in the split, and no image appears in two splits.
(That is, the union of "train.txt" + "val.txt" + "test.txt" = all ids, and the intersection is empty).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...