-
Notifications
You must be signed in to change notification settings - Fork 27.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make image processors more general #27690
Make image processors more general #27690
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. |
Thanks for opening this PR!
As discussed on slack, enabling all image processors to accept |
cc @ydshieh this is failing for KOSMOS-2 - it would be great to revert that change for KOSMOS-2 (i.e. remove the "use_square_size" attribute) since this is introduced for legacy behaviour of |
It did but it's also very convenient not to have to use copied from when the only difference was this, so reverting IMO is not the best solution. Let's rather adapt / make it compatible |
Reverting #26965 means we well have to add |
@ydshieh would it also be possible to just set size to |
Hi, could you give more details on
(where should I set this, for example.) Do you mean on the config file? |
f9a2b1f
to
135bc9d
Compare
Yes I meant in the |
We can keep your backwards compatibility code, and I could try to open Hub PRs to update them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a better and more general solution so in favor, I'll let @amyeroberts review when she comes back unless it's urgent! 😉
It's required to merge #27718 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding!
The test file will need to be removed before merging - otherwise looks good!
1dfef5c
to
bd71da3
Compare
Merge now as full (slow) CI on 4 models touched by this PR pass |
cc @younesbelkada we have a regression on this |
What does this PR do?
This PR undoes #26965 and instead makes image processors more general, by removing the hardcoded "shortest_side" arguments, allowing to pass the following to image processors:
Ideally it should also allow for the following (cc @amyeroberts)
Image processors should not be limited to only
{"shortest_edge": ...}
for instance, asCLIPImageProcessor
is at the moment. Thesize
argument is now always a dictionary containing one of these 4 possibilities; hence it would be great to support them all.