Git Product home page Git Product logo

tensorflow-bicubic-downsample's Introduction

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]

tensorflow-bicubic-downsample's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tensorflow-bicubic-downsample's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.