Skip to main content

PyTorch Image Quality Assessment

Project description

PIQA is not endorsed by Facebook, Inc.; PyTorch, the PyTorch logo and any related marks are trademarks of Facebook, Inc.

PyTorch Image Quality Assessment

This package is a collection of measures and metrics for image quality assessment in various image processing tasks such as denoising, super-resolution, image interpolation, etc. It relies heavily on PyTorch and takes advantage of its efficiency and automatic differentiation.

It should noted that piqa is directly inspired from the piq project. However, it focuses on the conciseness, readability and understandability of its (sub-)modules, such that anyone can freely and easily reuse and/or adapt them to its needs.

Nevertheless, conciseness is never at the expense of efficency; piqa's implementations are up to 4 times faster than those of other IQA PyTorch packages like kornia, piq and IQA-pytorch.

piqa should be pronounced pika (like Pikachu ⚡️)

Installation

The piqa package is available on PyPI, which means it is installable with pip:

pip install piqa

Alternatively, if you need the lastest features, you can install it using

git clone https://github.com/francois-rozet/piqa
cd piqa
python setup.py install

or copy the package directly to your project, with

git clone https://github.com/francois-rozet/piqa
cd piqa
cp -R piqa <path/to/project>/piqa

Getting started

The piqa package is divided in several submodules, each of which implements the functions and/or classes related to a specific image quality assessement metric.

import torch
from piqa import psnr, ssim

x = torch.rand(3, 3, 256, 256)
y = torch.rand(3, 3, 256, 256)

# PSNR function
l = psnr.psnr(x, y)

# SSIM instantiable object
criterion = ssim.SSIM().cuda()
l = criterion(x, y)

Metrics

Acronym Module Year Metric
TV piqa.tv 1937 Total Variation
PSNR piqa.psnr / Peak Signal-to-Noise Ratio
SSIM piqa.ssim 2004 Structural Similarity
MS-SSIM piqa.ssim 2003 Multi-Scale Structural Similarity
LPIPS piqa.lpips 2018 Learned Perceptual Image Patch Similarity
GMSD piqa.gmsd 2013 Gradient Magnitude Similarity Deviation
MS-GMSD piqa.gmsd 2017 Multi-Scale Gradient Magnitude Similiarity Deviation
MDSI piqa.mdsi 2016 Mean Deviation Similarity Index
HaarPSI piqa.haarpsi 2018 Haar Perceptual Similarity Index

Documentation

The documentation of this package is generated automatically using pdoc.

Code style

The code follows the Google Python style and is compliant with YAPF.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

piqa-1.0.9.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piqa-1.0.9-py3-none-any.whl (19.8 kB view details)

Uploaded Python 3

File details

Details for the file piqa-1.0.9.tar.gz.

File metadata

  • Download URL: piqa-1.0.9.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for piqa-1.0.9.tar.gz
Algorithm Hash digest
SHA256 28d5bbf5dce24957642ce641b022936f45fb33b1eb744c98fc71fcdf11fded6d
MD5 859f15d65e2ff5785801c4c034dea5cd
BLAKE2b-256 24103131ccceb7f59b61d9af9e8342cad5efbf8c3a668aabbee4d412f0797f6c

See more details on using hashes here.

File details

Details for the file piqa-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: piqa-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 19.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.22.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for piqa-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 50b2424f0395659ad88e0c876bbd4e36d76b320f6942d712797e7accb79d0495
MD5 a64ee56df4d5aade9aacbc5ee5b306f2
BLAKE2b-256 c5181a706915d6c24befe05f25abd89c61a6d091b208d88ddc3496e9c90412dc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page