Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
16 Commits
 
 
 
 
 
 

Repository files navigation

tensorflow-bicubic-downsample

tf.image.resize_images has aliasing when downsampling and does not define gradients for bicubic mode. This implementation fixes those problems.

Example

These images have been downsampled by a factor of 4 from the original. The results from this code matches the scipy.misc.imresize results exactly.

Method Result Comments
Original This is the original full res image.
tf.images.resize_images TF's implementation has aliasing
scipy.misc.imresize Proper bicubic downsampling
This code Matches scipy exactly

Usage

from bicubic_downsample import build_filter, apply_bicubic_downsample

# First, create the bicubic kernel. This can be reused in multiple downsample operations
k = build_filter(factor=4)

# Downsample x which is a tensor with shape [N, H, W, 3]
y = apply_bicubic_downsample(x, filter=k, factor=4)

# y now contains x downsampled to [N, H/4, W/4, 3]

About

tf.image.resize_images has aliasing when downsampling and does not have gradients for bicubic mode. This implementation fixes those problems.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.