`Mask2Former`: Several typos and unused (may unexpected) function parameters.
Author: Kamichanw
Pull request: no
Labels: name: bug

### System Info

The newest version.

### Who can help?

 @amyeroberts, @qubvel @stevhliu

### Information

- [x] The official example scripts
- [ ] My own modified scripts

### Tasks

- [x] An officially supported task in the `examples` folder (such as GLUE/SQuAD, ...)
- [ ] My own task or dataset (give details below)

### Reproduction

1. The type annotation `Dict(str, Tensor)` is weird and may be a typo:
https://github.com/huggingface/transformers/blob/7a3e208892c06a5e278144eaf38c8599a42f53e7/src/transformers/models/mask2former/modeling_mask2former.py#L2362
2. `pixel_mask` is actually unused, which is contradictory to its definition:
https://github.com/huggingface/transformers/blob/7a3e208892c06a5e278144eaf38c8599a42f53e7/src/transformers/models/mask2former/modeling_mask2former.py#L2224-L2309
3. Can @stevhliu further explain what is `class_labels` and `mask_labels` here? The current explanation may make readers confused.
https://github.com/huggingface/transformers/blob/7a3e208892c06a5e278144eaf38c8599a42f53e7/src/transformers/models/mask2former/modeling_mask2former.py#L2383-L2387 

### Expected behavior

1. The correct annotation should be `Dict[str, Tensor]`
2. If `pixel_mask` is useless, it should be removed.

Comments:
Would something like this be clearer? I'm not super familiar with `Mask2Former` though so this is just based on my brief understanding of it 😅 

```md
mask_labels (`List[torch.Tensor]`, *optional*):
    List of masks passed as inputs to the model for identifying and segmenting regions of an image. `num_labels` corresponds to the number of distinct objects in the task, and `height` and `width` are the dimensions of the mask.
class_labels (`List[torch.LongTensor]`, *optional*):
   List of target class labels passed as inputs to the model for mapping the `mask_labels` to specific object classes. For example, if `mask_labels[i][j]` represents a pixel in a segmentation mask and `class_labels[i][j]` provides the corresponding class label for that pixel.
```

1. For `mask_labels`, it could be better if you merge current and you newly suggested:
```
mask_labels (`List[torch.Tensor]`, *optional*):
    List of masks of shape `(num_labels, height, width)` passed as inputs to the model for identifying and segmenting regions of an image. `num_labels` corresponds to the number of distinct objects in the task, and `height` and `width` are the dimensions of the mask.
```
2. For `class_labels`, I still cannot tell the difference between it and `mask_labels`. In my humble opinions, `mask_labels` is already able to provide class information. For example, consider there are only two distinct types, let's say, dogs and cats for semantic segmentation, we have `3x3` `mask_labels` like this (`0` for background):
```
[
    0 0 0
    1 0 0
    1 1 0,
    0 1 1
    0 0 0
    0 0 0,
]
```
Then, the first `3x3` matrix denotes dogs, the latter denotes cats. It seems that we can already use this information to calculate the loss. What kind of information should `class_labels` provide?
3. There are a lot of attributes in config that should be further clarified, such as `feature_size` and `common_stride`.

@stevhliu I want to bring your attention that the original description of `class_labels` is totally **WRONG**. As you can see in the test script:
https://github.com/huggingface/transformers/blob/2932f318a20d9e54cc7aea052e040164d85de7d6/tests/models/mask2former/test_modeling_mask2former.py#L92
The `class_labels` should be a tensor with shape `[batch_size, num_labels]`, instead of `[batch_size, num_labels, height, width]`.

@amyeroberts, @qubvel `input_projectors` should be a `nn.ModuleList` instance, instead of a plain list.
https://github.com/huggingface/transformers/blob/7a3e208892c06a5e278144eaf38c8599a42f53e7/src/transformers/models/mask2former/modeling_mask2former.py#L2045-L2051