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.
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 |
amyeroberts
left a comment
There was a problem hiding this comment.
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, asCLIPImageProcessoris at the moment. Thesizeargument is now always a dictionary containing one of these 4 possibilities; hence it would be great to support them all.