[New Model] Add TimeSformer model
Author: fcakyon
Pull request: yes

# What does this PR do?

Fixes https://github.com/huggingface/transformers/issues/18724

- [x] Create a working environment for successful inference with the original source code
- [x] Create a debugging script for the original source code
- [x] Separate original model from original preprocessing pipeline
- [x] Test the original model with transformers/VideoMAEFeatureExtractor preprocessing pipeline
- [x] Port TimeSformer to HuggingFace/transformers
- [x] Adds tests for transformers/TimeSformer implementation
- [x] Update variable names to be more explicit


## Before submitting
- [x] 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?
- [x] 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.
- [x] 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?


@NielsRogge 


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

@NielsRogge I have added some tests, variable names require some work but maybe I can update names during PR review?

Hi @NielsRogge @fcakyon do you need help with finishing this and merging it? I'm happy to add the finishing touches

Currently I am a bit busy with my phd qualification exam, barely finding any free time. If I cannot find any time in the following weeks you may continue @Darktex 

@NielsRogge can you review it again, please? Tried to address all your concerns 👍 

> Thanks for your work, looks great to me.

Thanks for all the constructive feedback!


Hello @NielsRogge, thanks a lot for all the help you have provided. I have opened multiple PRs for the config and model files of all timesformer variants:
https://huggingface.co/facebook/timesformer-base-finetuned-k400/discussions/1
https://huggingface.co/facebook/timesformer-hr-finetuned-ssv2/discussions/1
https://huggingface.co/facebook/timesformer-hr-finetuned-k600/discussions/1
https://huggingface.co/facebook/timesformer-hr-finetuned-k400/discussions/1
https://huggingface.co/facebook/timesformer-base-finetuned-k600/discussions/2
https://huggingface.co/facebook/timesformer-base-finetuned-ssv2/discussions/2

Is there anything I should do about this PR?

Looks great on my side and ready to merge! Will let @NielsRogge double-check on last time and merge if he's happy :-)

Thanks for all your work!

Feel free to share on social media, we'll amplify ;)

Thanks a lot @NielsRogge, will share it after preparing a space :)

> Thanks for all your work!
> 
> Feel free to share on social media, we'll amplify ;)

I have shared it on [Twitter](https://twitter.com/fcakyon/status/1599305469017067521) and [Linkedin](https://www.linkedin.com/posts/fcakyon_timesformer-is-the-first-transformer-based-activity-7005071269373095936-Sb9-?utm_source=share&utm_medium=member_desktop) with the space demo link 🚀