divamgupta / image-segmentation-keras

Implementation of Segnet, FCN, UNet , PSPNet and other models in Keras.
https://divamgupta.com/image-segmentation/2019/06/06/deep-learning-semantic-segmentation-keras.html
MIT License
2.92k stars 1.16k forks source link

Multiclass Segmentation #362

Closed omerfguzel closed 2 years ago

omerfguzel commented 2 years ago

Hi, This question may compromise that I'm a brand new rookie in segmentation :) I need to implement multiclass segmentation for a project. So I have images and annotation images of 5 classes. I implemented binary segmentation succesfully using kreas-segmentation. But how can I implement multiclass with this module? Where should I put the different class annotations?

alastair5924 commented 2 years ago

I would also love to know the answer to this! I have a multiclass segmentation problem with 6 classes that I have been previously one-hot-encoding the classes into a (height, width,6) training sample. I have seen that there is an arg for "other_inputs_paths". If this is where the class masks are to be entered how do we structure the project to interpret this?

Or do we simply use the model as the Keras model and use the .fit() function of the functional model?

divamgupta commented 2 years ago

You dont need other_inputs_paths for standard mulit-class segmentation. You just need to make annotation images with pixel value as class ID. See the sample dataset and the code example in the readme.