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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.