Skip to content

Latest commit

 

History

History
87 lines (61 loc) · 4.22 KB

README.md

File metadata and controls

87 lines (61 loc) · 4.22 KB

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 be noted that piqa is directly inspired from the piq project, while focusing 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.

However, conciseness should never be at the expense of efficency; piqa's implementations are up to 2 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, requires_grad=True).cuda()
y = torch.rand(3, 3, 256, 256, requires_grad=True).cuda()

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

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

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 2004 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.