Rename second input dimension for ONNX-supported CV models
Author: regisss
Pull request: yes

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->

The second input dimension of `pixel_values` for CV models with ONNX support is currently named "sequence". This PR renames it to "num_channels".

Also:
- MobileViT is added to the list of models to test in `tests/onnx/test_onnx_v2.py`
- for DETR, the second input dimension is removed for `pixel_masks` because there is actually no channel dimension (`batch` x `height` x `width`)
- for MobileViT, a second input dimension is added to `pixel_values` so that it follows the same pattern as other vision models


## Before submitting
- [ ] This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
- [x] Did you read the [contributor guideline](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md#start-contributing-pull-requests),
      Pull Request section?
- [ ] Was this discussed/approved via a Github issue or the [forum](https://discuss.huggingface.co/)? Please add a link
      to it if that's the case.
- [ ] Did you make sure to update the documentation with your changes? Here are the
      [documentation guidelines](https://github.com/huggingface/transformers/tree/main/docs), and
      [here are tips on formatting docstrings](https://github.com/huggingface/transformers/tree/main/docs#writing-source-documentation).
- [x] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- Your PR will be replied to more quickly if you can figure out the right person to tag with @

 If you know how to use git blame, that is the easiest way, otherwise, here is a rough guide of **who to tag**.
 Please tag fewer than 3 people.

Models:

- albert, bert, xlm: @LysandreJik
- blenderbot, bart, marian, pegasus, encoderdecoder,  t5: @patrickvonplaten, @patil-suraj
- longformer, reformer, transfoxl, xlnet: @patrickvonplaten
- fsmt: @stas00
- funnel: @sgugger
- gpt2: @patrickvonplaten, @LysandreJik
- rag: @patrickvonplaten, @lhoestq
- tensorflow: @LysandreJik

Library:

- benchmarks: @patrickvonplaten
- deepspeed: @stas00
- ray/raytune: @richardliaw, @amogkam
- text generation: @patrickvonplaten
- tokenizers: @n1t0, @LysandreJik
- trainer: @sgugger
- pipelines: @LysandreJik

Documentation: @sgugger

HF projects:

- datasets: [different repo](https://github.com/huggingface/datasets)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Examples:

- maintained examples (not research project or legacy): @sgugger, @patil-suraj
- research_projects/bert-loses-patience: @JetRunner
- research_projects/distillation: @VictorSanh

 -->


Comments:
As discussed with @NielsRogge, it does not make much sense to call the second input dimension of `pixel_values` "sequence" while it is actually the number of channels. This can be misleading if one takes a closer look at the ONNX model (e.g. with Netron).

I re-ran all slow tests and they all passed.

_The documentation is not available anymore as the PR was closed or merged._

> I am not familiar enough with ONNX to evaluate if this breaks exiting code in any way, so could you please tell us whether a user will have to change anything in their code due to this change?

Axe names do not matter for exporting the model or performing inference with it. The only use case I could think of is if one has a script to parse the ONNX graph and does any kind of operation involving axe names, but this would rely on tools that are not provided by Transformers anyway.

What do you think @lewtun @michaelbenayoun @mfuntowicz ?

This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/main/CONTRIBUTING.md) are likely to be ignored.

Gently pinging @lewtun here

Pinging @michaelbenayoun and @JingyaHuang as Lewis is off for a few weeks.

Yes, I do not think it is a breaking change either. Same question as @JingyaHuang : do we need dynamic axes for the channels?

@JingyaHuang @michaelbenayoun I guess some models can deal with both grayscale and RGB images. I let @NielsRogge confirm here.

Yes technically the channel dimension can be 1 for greyscale images, 3 for RGB images, and 4 for RGBA images.

Thank you! I was super confused while working on #18587, where I don't know if change to better names will break things or not.