feat: add `is_fast` to ImageProcessor
Author: MilkClouds
Pull request: yes

# What does this PR do?

Tokenizer has `is_fast` but ImageProcessor is not. I added simple `is_fast` property to ImageProcessor.


## 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#create-a-pull-request),
      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?

@zucchini-nlp may able to review this!

<!-- 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:

- text models: @ArthurZucker
- vision models: @amyeroberts, @qubvel
- speech models: @eustlb
- graph models: @clefourrier

Library:

- flax: @gante and @Rocketknight1
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Rocketknight1
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @zach-huggingface, @SunMarc and @qgallouedec
- chat templates: @Rocketknight1

Integrations:

- deepspeed: HF Trainer/Accelerate: @SunMarc @zach-huggingface
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc @MekkCyber

Documentation: @stevhliu

HF projects:

- accelerate: [different repo](https://github.com/huggingface/accelerate)
- datasets: [different repo](https://github.com/huggingface/datasets)
- diffusers: [different repo](https://github.com/huggingface/diffusers)
- rust tokenizers: [different repo](https://github.com/huggingface/tokenizers)

Maintained examples (not research project or legacy):

- Flax: @Rocketknight1
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->


Comments:
cc @yonigozlan as well

Hey! This can indeed be helpful, but why add it if it's not used anywhere? what's the rationale?

I think that's because the fact that fast version of processor exist is not well known to users. I also didn't know it before few weeks ago and my coworkers also nobody knew about this. 

Also people rarely cares about efficiency of image processor since it's not important for large model scenario. But for small multimodal language models(e.g. SmolVLM2-256M) image processor's effect is huge. (e.g. SmolVLM2 image processor without "use_fast" took 70ms for image processing, which is very huge for latency-aware scenario. We serve MLLM to robotics navigation.)

Anyway I think in the future people gonna take care of this, so this PR will be helpful to users, hopefully.

My personal reason why I created this PR is because there was no way to ensure loaded processor is fast or not(as I said before it's very critical to our use cases)

But broader support for "fast" api for image processor would be more helpful as reviewers are mentioning.

Agree with you @MilkClouds !

Definitely think that we could use this, especially as we are rolling out loading Fast Image Processor by default (@MilkClouds see https://github.com/huggingface/transformers/pull/39591), this will be more and more useful for users.
As for changing the API @ArthurZucker, this seems like an addition targeted towards users and not really for internal library use, so not sure if we really need any updates here, unless I misunderstood what you meant.

@MilkClouds Looks like you're missing an import in `test_image_processing_common.py`, you'll need to add something like this at the top of the file:
```python
from transformers.utils import is_torch_available, is_vision_available, is_torchvision_available

if is_torchvision_available():
    from transformers.image_processing_utils_fast import BaseImageProcessorFast
```

@yonigozlan I added missing import!

So the idea is only for users to have an easy way to know if the processor is fast or not if I understand correctly?

Yes but rather than saying it "easy" way, saying it "official" way would be more appropriate. I want stable API for discriminating/asserting fast image processor.

You do need to fix the tests though!

Sorry, I didn't noticed that test is failing due to my mistake(I thought test is failing due to other reasons) I've fixed test to work, check plz @Cyrilvallez 

The docs for this PR live [here](https://moon-ci-docs.huggingface.co/docs/transformers/pr_39603). All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.