Uniformize kwargs for processors - GroundingDINO
Author: SangbumChoi
Pull request: yes

# What does this PR do?

<!--
Congratulations! You've made it this far! You're not quite done yet though.

Once merged, your PR is going to appear in the release notes with the title you set, so make sure it's a great title that fully reflects the extent of your awesome contribution.

Then, please replace this with a description of the change and which issue is fixed (if applicable). Please also include relevant motivation and context. List any dependencies (if any) that are required for this change.

Once you're done, someone will review your PR shortly (see the section "Who can review?" below to tag some potential reviewers). They may suggest changes to make the code even better. If no one reviewed your PR after a week has passed, don't hesitate to post a new comment @-mentioning the same persons---sometimes notifications get lost.
-->

<!-- Remove if not applicable -->


Fixes one model from https://github.com/huggingface/transformers/issues/31911

We don;t want our tracker issue to be closed after the PR is merged, so I edited the magic keyword a bit


## 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?
- [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).
- [ ] Did you write any new necessary tests?


## Who can review?

Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.

<!-- 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
- speech models: @sanchit-gandhi
- graph models: @clefourrier

Library:

- flax: @sanchit-gandhi
- generate: @zucchini-nlp (visual-language models) or @gante (all others)
- pipelines: @Narsil
- tensorflow: @gante and @Rocketknight1
- tokenizers: @ArthurZucker
- trainer: @muellerzr and @SunMarc

Integrations:

- deepspeed: HF Trainer/Accelerate: @muellerzr
- ray/raytune: @richardliaw, @amogkam
- Big Model Inference: @SunMarc
- quantization (bitsandbytes, autogpt): @SunMarc 

Documentation: @stevhliu and @MKhalusova

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: @sanchit-gandhi
- PyTorch: See Models above and tag the person corresponding to the modality of the example.
- TensorFlow: @Rocketknight1

 -->

@zucchini-nlp @NielsRogge @EduardoPach 

Comments:
@zucchini-nlp https://github.com/huggingface/transformers/blob/2c8180acd9d7fc9b91f56425e281ac7237ce3305/tests/test_processing_common.py#L80
I think the circleCI fails since the upper PR is not merged in to main. Otherwise requesting for second review!

@molbap @zucchini-nlp Hi my PR is ready to review. However, since https://github.com/huggingface/transformers/pull/31368 this is ongoing PR, I recommend you to look upper comment. There are two major modification to pass the CI. 

Current CI has error of `align` models which says considered in https://github.com/huggingface/transformers/pull/31368 according to https://github.com/huggingface/transformers/issues/31911. (I think molbap's PR does not currently updated to consider align model)

@zucchini-nlp Sorry for the inconvinience. Merging @molbap ongoing PR made you confuse the overall PR. I will re-comment or fix on the every comment you. Also I will just revert to the main and try to solve as much as I can and ping you again :)

@zucchini-nlp Hi now I understand the full logic and had a one question on this PR.
It seems that initial PR was designed in here

https://github.com/huggingface/transformers/pull/31197/files#diff-767679f9407c55e91d247ac9ab5359a867414676ae6083959bd2c5cf4e1113c7

with based on following image processor

https://github.com/molbap/transformers/blob/bcce00766b8faa0bd48e0dfe4d0ec72db761f56a/src/transformers/models/efficientnet/image_processing_efficientnet.py

However, not all the processor has the `crop_size` argument for image_processor some of them has only `size`. I think in order to make it model-wise compatibility I recommend to change this to `size`.

https://github.com/molbap/transformers/blob/bcce00766b8faa0bd48e0dfe4d0ec72db761f56a/tests/test_processing_common.py

otherwise I can override these test for groundingdino only

WDYT? cc. @molbap 

**(BTW, I reverted all the irrelevant commit and major CI fail is related to this comment)**

IIRC the test will fail if we pass in both, crop_size and size, because one of the args will not be used by image processor. If that's the case, we can override since it is about making tests happy

Since only these two arguments are passed, we could also `inspect` in the test method and figure out which is used for a given model, then call with that one - skipping the test entirely is also acceptable, yes

> IIRC the test will fail if we pass in both, crop_size and size, because one of the args will not be used by image processor. If that's the case, we can override since it is about making tests happy

Well this was not the exactly the case. As I mentioned GroundingDINO processor -> image_processor does not have function of `crop_size`. However, the major test in `test_processor_common.py` uses `crop_size` which is not used in the groundingdino. This will result the output shape as same as input since resizing technique is not applied. 

I manually changed this to inherit `size` instead of `crop_size` to add resizing technique!

@zucchini-nlp Request for the review!


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