-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Uniformize model processors (models *with* special arg names) #32841
base: main
Are you sure you want to change the base?
Changes from all commits
508e1a4
257c690
93e7070
0128d19
8c36cfb
3a2f7ef
a280b3a
ca925cc
71a7ee1
274b615
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,6 +183,7 @@ def pad_image( | |
input_data_format (`ChannelDimension` or `str`, *optional*): | ||
The channel dimension format of the input image. If not provided, it will be inferred. | ||
""" | ||
size = get_size_dict(size) | ||
output_height, output_width = size["height"], size["width"] | ||
input_height, input_width = get_image_size(image, channel_dim=input_data_format) | ||
|
||
|
@@ -232,6 +233,7 @@ def thumbnail( | |
The channel dimension format of the input image. If not provided, it will be inferred. | ||
""" | ||
input_height, input_width = get_image_size(image, channel_dim=input_data_format) | ||
size = get_size_dict(size) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. not clear why we needed these changes, was this causing CI failure? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these are utils for old processors that don't support the new image size format yet we might as well add these here since (1) they help w/ backwards compatibility, (2) make the image-text-to-text pipeline easier to implement, & (3) they just revert to a no-op if |
||
output_height, output_width = size["height"], size["width"] | ||
|
||
# We always resize to the smallest of either the input or output size. | ||
|
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.
another thing we're doing now is swap the arg order, so that it is
image, text, audio, videos
. And that needs another deprecation cycle...BTW, i am quite out of the loop, do we need this order-swapping for pipeline @yonigozlan ?