Repository: transformers
Issue: Community contribution: enable dynamic resolution input for more vision models.
Labels: Good First Issue,Vision

### Feature request

Some of our models interpolate its positional embeddings, enabling pretrained checkpoints to be used on different input resolutions. For example, [here in ViT](https://github.com/huggingface/transformers/blob/75bbfd5b2237b7e35a9265731ecf63022579e7e2/src/transformers/models/vit/modeling_vit.py#L79). 

- [x] [beit](https://github.com/huggingface/transformers/blob/main/src/transformers/models/beit/modeling_beit.py) & [data2vec](https://github.com/huggingface/transformers/blob/main/src/transformers/models/data2vec/modeling_data2vec_vision.py) @OmarManzoor #31053
- [x] [blip](https://github.com/huggingface/transformers/blob/main/src/transformers/models/blip/modeling_blip.py), [blip_2](https://github.com/huggingface/transformers/blob/main/src/transformers/models/blip_2/modeling_blip_2.py) @zafstojano #30722
- [x] [clip](https://github.com/huggingface/transformers/blob/main/src/transformers/models/clip/modeling_clip.py) and clip related models: [altclip](https://github.com/huggingface/transformers/blob/main/src/transformers/models/altclip/modeling_altclip.py), [bridgetower](https://github.com/huggingface/transformers/blob/main/src/transformers/models/bridgetower/modeling_bridgetower.py), [chinese_clip](https://github.com/huggingface/transformers/blob/main/src/transformers/models/chinese_clip/modeling_chinese_clip.py), [git](https://github.com/huggingface/transformers/blob/main/src/transformers/models/git/modeling_git.py), [kosmos2](https://github.com/huggingface/transformers/blob/main/src/transformers/models/kosmos2/modeling_kosmos2.py) ~#30783~ #32600
- [x] [deit](https://github.com/huggingface/transformers/blob/main/src/transformers/models/deit/modeling_deit.py) #31131 
- [ ] [owlvit](https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlvit/modeling_owlvit.py), [owlv2](https://github.com/huggingface/transformers/blob/main/src/transformers/models/owlv2/modeling_owlv2.py) @yMayanand https://github.com/huggingface/transformers/pull/34764
- [x] [perceiver](https://github.com/huggingface/transformers/blob/main/src/transformers/models/perceiver/modeling_perceiver.py) @g1y5x3 #30979 
- [x] [siglip](https://github.com/huggingface/transformers/blob/main/src/transformers/models/siglip/modeling_siglip.py) @davidgxue https://github.com/huggingface/transformers/pull/30719
- [x] [swin](https://github.com/huggingface/transformers/blob/main/src/transformers/models/swin/modeling_swin.py), [donut](https://github.com/huggingface/transformers/blob/main/src/transformers/models/donut/modeling_donut_swin.py), [maskformer swin](https://github.com/huggingface/transformers/blob/main/src/transformers/models/maskformer/modeling_maskformer_swin.py), [swinv2](https://github.com/huggingface/transformers/blob/main/src/transformers/models/swinv2/modeling_swinv2.py) #30656 @the-neural-networker 
- [x] [tvp](https://github.com/huggingface/transformers/blob/main/src/transformers/models/tvp/modeling_tvp.py) @bhuvanmdev #30863
- [x] [vit_mae](https://github.com/huggingface/transformers/blob/main/src/transformers/models/vit_mae/modeling_vit_mae.py) #30657 #30732 @bhuvanmdev 
- [x] [vivit](https://github.com/huggingface/transformers/blob/main/src/transformers/models/vivit/modeling_vivit.py) #30630 @jla524 

### Motivation

Let's add this to more models, to leverage existing checkpoints for new cases! 

### Your contribution

For anyone who would like to contribute, please comment on the issue, claiming a model you'd like to work on and share a link to the PR. 

Each PR should: 
* Add an `interpolate_pos_encoding` method
* Add a test showing the model can correctly interpolate an input image of a different size

There was a PR opened to add this to CLIP models, which is now inactive, but useful for reference of the changes to make: https://github.com/huggingface/transformers/pull/27457

Once the PR is ready, you can ping me for review 🤗