Fix some pipeline tests
Author: ydshieh
Pull request: yes

# What does this PR do?

- change `feature_extractor=...` to `image_processor=...` in `test_pipeline_XXX` files, if `XXX` is vision tasks.
  - this doesn't affect any backward compatibility - they are just testing files
- change `self.feature_extractor(...)` to `self.image_processor()` in some vision pipeline files
  - the backward compatibility is ensured by the change in `base.py` (parent class `Pipeline.__init__`):
    ```python
    if self.image_processor is None and self.feature_extractor is not None:
        # Backward compatible change, if users called
         # ImageSegmentationPipeline(.., feature_extractor=MyFeatureExtractor())
         # then we should keep working
         self.image_processor = self.feature_extractor
    ```
- A few other fixes, see review comments  

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

> Let's stop adding tests of new models in the pipelines until the metaclass is removed and we have a mixin class that all model testers inherit from (I think that is the plan, right?) 

Yes, that's the plan! For now, no new models will be added in pipeline testing (because we need to create and upload the tiny model on the Hub, and I guess no one knows how to do it except me, and I definitely will keep my life easier :-)

> as we can't add a succession of tests in the pipeline common tests to change behavior for this or that model.

Sure!



Failing test is irrelevant to this PR.

For transparancy: I need to add back the following block in `src/transformers/pipelines/__init__.py`:
```python
    # If `model` (instance of `PretrainedModel` instead of `str`) is passed (and/or same for config), while
    # `image_processor` or `feature_extractor` is `None`, the loading will fail. This happens particularly for some
    # vision tasks when calling `pipeline()` with `model` and only one of the `image_processor` and `feature_extractor`.
    # TODO: we need to make `NO_IMAGE_PROCESSOR_TASKS` and `NO_FEATURE_EXTRACTOR_TASKS` more robust to avoid such issue.
    # This block is only temporarily to make CI green.
    if load_image_processor and load_feature_extractor:
        load_feature_extractor = False
```

 The issue comes from the fact of calling `pipeline()` with:

 - a model (not string)
 - one of `image_processor` or `feature_extractor` being specified, but another one is `None`
 - tasks involving vision models, so both `load_image_processor` and `load_feature_extractor` are `True`

then it will fail around https://github.com/huggingface/transformers/blob/c2f623cf53a9a8b2e192135b03ae211ba1ce3695/src/transformers/pipelines/__init__.py#L863

Without this change, the following 2 tests just fails
- DocumentQuestionAnsweringPipelineTests::test_pt_LayoutLMv2Config_LayoutLMv2ForQuestionAnswering_LayoutLMv2TokenizerFast_LayoutLMv2ImageProcessor (not tested before)
- tests/pipelines/test_pipelines_image_segmentation.py::ImageSegmentationPipelineTests::test_maskformer (already failed since the PR #20851 one week ago)

**We need to improve this `pipeline.__init__.py` to make it more robust regarding the feature_extractor/image_processor while we want to keep backward compatibility**

This should go in a separate PR though, I will merge this PR as it is, unless you strongly against the changes in the last 2 commits.