🚨Default to fast image processors for all models
Author: yonigozlan
Pull request: yes

# What does this PR do?

Following the trial testing with Qwen_VL image processors, this extends defaulting to fast image processors even for checkpoints saved with a slow one to all models.

Also made sure that all processors use AutoImageProcessor to instantiate their image_processor_class.
On that point, defining default subclass in processors feels a bit redundant, as we basically already have that in auto classes. It would be nice to get rid of this for v5, wdyt @molbap @zucchini-nlp @ArthurZucker ?
I'll open a PR for that too.

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

> LGTM. Just wondering about some models where we had no lancsoz resampling. Do we get the closest resampling in those cases and are the diffs small enough?

Good point for the lanczos sampling, I might add an exception for these, as the diffs are not close enough imo

run-slow: aria, clip, efficientloftr, emu3, fuyu, idefics2, idefics3, janus, kosmos2, kosmos2_5, layoutxlm, lightglue, llava_onevision, mllama, oneformer

This comment contains `run-slow`, running the specified jobs: 

models: ["models/aria", "models/clip", "models/efficientloftr", "models/emu3", "models/fuyu", "models/idefics2", "models/idefics3", "models/janus", "models/kosmos2", "models/kosmos2_5", "models/layoutxlm", "models/lightglue", "models/llava_onevision", "models/mllama", "models/oneformer"]
quantizations: []

## CI Results
[Workflow Run ⚙️](https://github.com/huggingface/transformers/actions/runs/19731275109)

### Model CI Report

#### ❌ Failed tests

- [clip](https://github.com/huggingface/transformers/actions/runs/19731275109/job/56533202108):
    tests/models/clip/test_modeling_clip.py::CLIPModelIntegrationTest::test_inference_interpolate_pos_encoding

- [janus](https://github.com/huggingface/transformers/actions/runs/19731275109/job/56533202165):
    tests/models/janus/test_modeling_janus.py::JanusIntegrationTest::test_model_generate_images

- [kosmos2_5](https://github.com/huggingface/transformers/actions/runs/19731275109/job/56533202041):
    tests/models/kosmos2_5/test_modeling_kosmos2_5.py::Kosmos2_5ModelIntegrationTest::test_eager

- [oneformer](https://github.com/huggingface/transformers/actions/runs/19731275109/job/56533202048):
    tests/models/oneformer/test_modeling_oneformer.py::OneFormerModelIntegrationTest::test_inference_no_head
    tests/models/oneformer/test_modeling_oneformer.py::OneFormerModelIntegrationTest::test_inference_universal_segmentation_head



I have pushed the updates. The following remaining failures needs some fix (not about expected output mismatching)

(if you want to read the log, you can go [here](https://github.com/huggingface/transformers/actions/runs/19993587281/job/57338010590) and select ⚙️ icon  and click `View raw logs` on the top left side)


This one 

> RUN_SLOW=1 python3 -m pytest -v tests/models/janus/test_modeling_janus.py::JanusIntegrationTest::test_model_generate_images - ValueError: Only returning PyTorch tensors is currently supported.

plus the following

```json
{
    "clipseg": {
        "single-gpu": [
            {
                "test": "tests/models/clipseg/test_modeling_clipseg.py::CLIPSegModelIntegrationTest::test_inference_image_segmentation",
                "commit": "07a50c395552a28582c2746e06318e8f2e1bf059",
                "status": "git bisect found the bad commit.",
                "pr_number": null,
                "author": "ydshieh",
                "merged_by": null,
                "parent": "377a8ee73f210476c4efb15170d0c32ad3b2c653"
            }
        ]
    },
    "flava": {
        "single-gpu": [
            {
                "test": "tests/models/flava/test_modeling_flava.py::FlavaForPreTrainingIntegrationTest::test_inference",
                "commit": "07a50c395552a28582c2746e06318e8f2e1bf059",
                "status": "git bisect found the bad commit.",
                "pr_number": null,
                "author": "ydshieh",
                "merged_by": null,
                "parent": "377a8ee73f210476c4efb15170d0c32ad3b2c653"
            }
        ]
    },
    "gemma3": {
        "single-gpu": [
            {
                "test": "tests/models/gemma3/test_modeling_gemma3.py::Gemma3IntegrationTest::test_model_4b_batch_crops",
                "commit": "07a50c395552a28582c2746e06318e8f2e1bf059",
                "status": "git bisect found the bad commit.",
                "pr_number": null,
                "author": "ydshieh",
                "merged_by": null,
                "parent": "377a8ee73f210476c4efb15170d0c32ad3b2c653"
            },
            {
                "test": "tests/models/gemma3/test_modeling_gemma3.py::Gemma3IntegrationTest::test_model_4b_crops",
                "commit": "07a50c395552a28582c2746e06318e8f2e1bf059",
                "status": "git bisect found the bad commit.",
                "pr_number": null,
                "author": "ydshieh",
                "merged_by": null,
                "parent": "377a8ee73f210476c4efb15170d0c32ad3b2c653"
            }
        ]
    },
    "yolos": {
        "single-gpu": [
            {
                "test": "tests/models/yolos/test_modeling_yolos.py::YolosModelIntegrationTest::test_inference_object_detection_head",
                "commit": "07a50c395552a28582c2746e06318e8f2e1bf059",
                "status": "git bisect found the bad commit.",
                "pr_number": null,
                "author": "ydshieh",
                "merged_by": null,
                "parent": "377a8ee73f210476c4efb15170d0c32ad3b2c653"
            }
        ]
    }
}
```

Hey @ydshieh ! All the remaining tests should be fixed. I tried to merge with main, but there seems to be a lot of broken tests due to tokenization issues on main (the gemma3 and janus integration tests are broken at least)

I think it will be easier to transition to a unified image processor backend (defaulting on torch/torchvision) if we first merge this PR.
Also do you have more info on memory leaks? Not sure what this alludes to 

**[For maintainers]** Suggested jobs to run (before merge)

run-slow: altclip, aria, auto, aya_vision, chinese_clip, clip, clipseg, convnext, convnextv2, cvt, efficientloftr, fuyu, idefics2, idefics3, janus, lightglue

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=41388&sha=aca384