Use pytorch-like `ignore_index` instead of `remove_bg` for IoU
🚀 Feature
PL's implementation of the IoU metric has a remove_bg flag that allows to ignore the background class.
I propose changing it to be the same as PyTorch's loss functions,
that is an ignore_index argument that takes the index of the class to be ignored.
Motivation for the proposal
Currently when remove_bg is set to True, the background is expected to be associated to index 0.

This is not a constant among datasets, for example Cityscapes uses index 255 for its ignored semantic segmentation class.
Pytorch's loss functions for classification that allow to ignore a class do it with an ignore_index argument, like CrossEntropyLoss.

That means that when using those the way they are intended to be, you have to manually move the ignored class' channel at the beginning of the tensor in-between the loss and metric computation, and I don't like having that in the middle of my training step.

Pitch
I'd like to have the same interface as PyTorch's loss functions with the ignore_index argument.
On a side note, I also think that the documentation should display the expected shape of inputs, like PyTorch' loss functions, and not keep quiet about the automatic adaptation to cases when the prediction is given in one-hot encoding or as an index array.

Alternatives
Appart from modifying the data between loss an metric computation in the training step, it should be possible to do it at the data-set creation level, with custom transformations, and then use an ignore_index=0 for the loss function.
For the first method, this is what I add:
# set ignored class at pos 0
y_pred = torch.roll(y_pred, shifts=1, dims=1)
y = torch.add(y, 1)
y[y == 256] = 0