Git Product home page Git Product logo

perceptual-quality's Introduction

Perceptual quality metrics for TensorFlow

This project contains differentiable perceptual quality metrics implemented in the TensorFlow framework.

Installation

pip install https://github.com/google-research/perceptual-quality/archive/master.zip

PIM

This is an implementation of the perceptual information metric, as described in:

"An Unsupervised Information-Theoretic Perceptual Quality Metric"
S. Bhardwaj, I. Fischer, J. Ballé, T. Chinen
https://proceedings.neurips.cc/paper/2020/file/00482b9bed15a272730fcb590ffebddd-Paper.pdf

Usage:

from perceptual_quality import pim

model = pim.load_trained("pim-5")

# image_A, image_B: 4D tensors, batch x height x width x 3, sRGB colorspace.
# Returns the PIM distance between A and B for each batch element.
distance = model(image_A/255, image_B/255)

# Returns a `Distribution` object with the latent representation of the image.
distribution = model(image_A/255)

Refer to the online help of pim.PIM.call() for further information on supported image formats, etc.

NLPD

This is an implementation of the normalized Laplacian pyramid distance, as described in:

"Perceptually optimized image rendering"
V. Laparra, A. Berardino, J. Ballé and E. P. Simoncelli
https://doi.org/10.1364/JOSAA.34.001511

Usage:

from perceptual_quality import nlpd

# image_A, image_B: at least 3D tensors, height x width x 3, sRGB or grayscale.
# Will return one number per color channel. Can also be batched.
distance = nlpd.nlpd(image_A, image_B)
distance = nlpd.nlpd_fast(image_A, image_B)

# Returns a list of tensors with the subband representation of the image.
model = nlpd.NLP()
subbands = model(image_A)

Refer to the online help of nlpd.nlpd(), nlpd.nlpd_fast(), and nlpd.NLP() for further information on supported image formats, assumed display characteristics, etc.

Authors

  • Sangnie Bhardwaj (github: sangnie)
  • Johannes Ballé (github: jonycgn)
  • Ian Fischer (github: iansf)

Note that this is not an officially supported Google product.

perceptual-quality's People

Contributors

jonycgn avatar

Watchers

James Cloos avatar

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.