[SegFormer] Add support for segmentation masks with one label
# What does this PR do?

This PR makes it possible to fine-tune SegFormer in case you have a mask containing only a single value, i.e. your mask could look like [[255, 0], [0, 255]]. In this case, config.num_labels = 1 and the ignore index is 255.

If this works fine, then we can add it to any other model supported by `AutoModelForSemanticSegmentation`.


_The documentation is not available anymore as the PR was closed or merged._<|||||>How soon will this PR be done? And why using BCEWithLogitsLoss not Dice loss?<|||||>when is this going to be closed. Our team would like to use it<|||||>when this becomes active, how would one use it.

thank you nielsrogge for sending for review.<|||||>hello @NielsRogge 

hope I didnt disturb

I tried to peel off the classifier in pytorch and change the output channels to one, then manually compute the loss instead of getting it from the segformer huggingface object, so basically I just got the output and then did a dice loss myself.

So i tried to write bin seg myself kinda, and I started to get a bunch of negative values.

Any idea why that happened, and how I could fix it? I mean, I replaced the last conv2d layer.<|||||>Is this now automatically using dice loss when we set `num_labels = 1`? Maybe I missed it but it seems the documentation doesn't explain it.<|||||>HHi @aegonwolf,

When config.num_labels = 1, the binary cross-entropy loss is used, as can be seen here: https://github.com/huggingface/transformers/blob/1689aea73346816b936b84932e12b774974e61a6/src/transformers/models/segformer/modeling_segformer.py#L813-L817.