SHI-Labs / OneFormer

OneFormer: One Transformer to Rule Universal Image Segmentation, arxiv 2022 / CVPR 2023
https://praeclarumjj3.github.io/oneformer
MIT License
1.41k stars 128 forks source link

How to train Binary Semantic Segmentation #44

Closed gjustin40 closed 1 year ago

gjustin40 commented 1 year ago

Thank you for sharing good resources. I am trying to do binary Semantic Segmentation with only one class. The data I have currently are images and masks, and the masks are labeled with 0 and 1 (background 0, foreground 1).

I've looked at the code provided by OneFormer on GitHub, but all the examples are for instances(panoptic), and I couldn't find any examples of semantic segmentation using just images and masks without a Json file used in instances. So, I'm asking you this question. (I've tried training semantic segmentation with the ade20k dataset as an example, but even then, instance annotations were essential.)

Is it possible to do semantic segmentation without a panoptic (or instance) annotations file? If so, what resources should I refer to? It's a bit complicated, so it's a bit difficult to understand. Thank you.

praeclarumjj3 commented 1 year ago

Hi @gjustin40, thanks for your interest in our work.

You must write a custom dataset mapper to train a model on only semantic segmentation. Please look at the semantic dataset mapper here. Let me know if you have any more questions.

praeclarumjj3 commented 1 year ago

Closing this, feel free to re-open if you have more questions

SouLeo commented 9 months ago

@gjustin40 were you able to make progress on this? I'm having similar issues.