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

use 'nearest' rather than 'bilinear' as default interpolation method when resizing images #8435

Merged
merged 1 commit into from
Nov 8, 2017
Merged

use 'nearest' rather than 'bilinear' as default interpolation method when resizing images #8435

merged 1 commit into from
Nov 8, 2017

Conversation

jjallaire
Copy link
Contributor

Addresses: #8426

In versions prior to 2.0.9 there was no interpolation option so we always used the default interpolation mode of 'nearest'. With 2.0.9 interpolation can be specified however the default is bilinear, which can lead to subtly different results than in previous versions. This PR ensures that the image resizing behavior remains identical for code that doesn't specify an interpolation explicitly.

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!

@adityapatadia
Copy link

Was this commit done?

v2.1.4 release notes also state that the interpolation was changed from nearest to bicubic, but that release in fact has only nearest. Check this: https://github.com/keras-team/keras/blob/2.1.4/keras/preprocessing/image.py#L324

All the tensorflow code samples use bilinear interpolations and I think the same should be used in Keras. Reference of tensorflow code here: https://github.com/tensorflow/models/blob/master/research/slim/preprocessing/inception_preprocessing.py#L277

@fchollet please look into this. The release notes and actual implementation is conflicting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants