Skip to content
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

Fix usage of deprecated Pillow interpolation methods #16746

Merged

Conversation

neoaggelos
Copy link
Contributor

@neoaggelos neoaggelos commented Jul 3, 2022

Summary

This small PR updates the interpolation methods used by Keras to resolve the following DeprecationWarning messages.

Note that this is important since Pillow is not pinned in the requirements.txt, and Pillow 10 will remove the used values.

keras/utils/image_utils.py:36 DeprecationWarning: NEAREST is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.NEAREST or Dither.NONE instead.
    'nearest': pil_image.NEAREST,

keras/utils/image_utils.py:37 DeprecationWarning: BILINEAR is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BILINEAR instead.
    'bilinear': pil_image.BILINEAR,

keras/utils/image_utils.py:38 DeprecationWarning: BICUBIC is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BICUBIC instead.
    'bicubic': pil_image.BICUBIC,

keras/utils/image_utils.py:39 DeprecationWarning: HAMMING is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.HAMMING instead.
    'hamming': pil_image.HAMMING,

keras/utils/image_utils.py:40 DeprecationWarning: BOX is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.BOX instead.
    'box': pil_image.BOX,

keras/utils/image_utils.py:41 DeprecationWarning: LANCZOS is deprecated and will be removed in Pillow 10 (2023-07-01). Use Resampling.LANCZOS instead.
    'lanczos': pil_image.LANCZOS,

Versions

$ pip freeze | grep Pillow
Pillow==9.2.0

@google-cla
Copy link

google-cla bot commented Jul 3, 2022

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@neoaggelos neoaggelos force-pushed the fix/deprecated-pillow-constants branch from aaa436b to 9e5d764 Compare July 3, 2022 11:04
@gbaned gbaned requested a review from fchollet July 4, 2022 15:06
@google-ml-butler google-ml-butler bot added the keras-team-review-pending Pending review by a Keras team member. label Jul 4, 2022
Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

keras/utils/image_utils.py Show resolved Hide resolved
@neoaggelos neoaggelos requested a review from fchollet July 5, 2022 06:06
Copy link
Member

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to pull Ready to be merged into the codebase size:S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants