All Projects → francois-rozet → Piqa

francois-rozet / Piqa

Licence: mit
PyTorch Image Quality Assessement package

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Piqa

Phpmetrics
Beautiful and understandable static analysis tool for PHP
Stars: ✭ 2,180 (+1918.52%)
Mutual labels:  quality, metrics
Cppdep
C/C++ Dependency Analyzer: a rewrite of John Lakos' dep_utils (adep/cdep/ldep) from "Large-Scale C++ Software Design"
Stars: ✭ 115 (+6.48%)
Mutual labels:  quality, metrics
Ruby Gem Downloads Badge
Clean and simple gem downloads count badge, courtesy of http://shields.io/. You can checkout the application directly at the following URL:
Stars: ✭ 29 (-73.15%)
Mutual labels:  image, metrics
Jpeek
Java Code Static Metrics (Cohesion, Coupling, etc.)
Stars: ✭ 168 (+55.56%)
Mutual labels:  quality, metrics
Dart Code Metrics
Software analytics tool that helps developers analyse and improve software quality.
Stars: ✭ 96 (-11.11%)
Mutual labels:  quality, metrics
Grid
The Guardian’s image management system
Stars: ✭ 1,380 (+1177.78%)
Mutual labels:  image
Carbon
Carbon is one of the components of Graphite, and is responsible for receiving metrics over the network and writing them down to disk using a storage backend.
Stars: ✭ 1,435 (+1228.7%)
Mutual labels:  metrics
Evo
Python package for the evaluation of odometry and SLAM
Stars: ✭ 1,373 (+1171.3%)
Mutual labels:  metrics
Review object detection metrics
Review on Object Detection Metrics: 14 object detection metrics including COCO's and PASCAL's metrics. Supporting different bounding box formats.
Stars: ✭ 100 (-7.41%)
Mutual labels:  metrics
Prometheus
The Prometheus monitoring system and time series database.
Stars: ✭ 40,114 (+37042.59%)
Mutual labels:  metrics
Hdimageview
一个加载高清大图支持缩放的控件
Stars: ✭ 107 (-0.93%)
Mutual labels:  image
Vscam
Photography, Communication & Share - Minimalist picture sharing app.
Stars: ✭ 105 (-2.78%)
Mutual labels:  image
Appmetrics.js
A small (< 1kb) library for measuring things in your web app and reporting the results to Google Analytics.
Stars: ✭ 1,383 (+1180.56%)
Mutual labels:  metrics
Serverless Image Processor
AWS Lambda image processor
Stars: ✭ 106 (-1.85%)
Mutual labels:  image
Lipo
👄 Free image manipulation API service built on top of Sharp (an alternative to Jimp, Graphics Magic, Image Magick, and PhantomJS)
Stars: ✭ 101 (-6.48%)
Mutual labels:  image
Pingprom
Prometheus uptime monitoring quickstart
Stars: ✭ 107 (-0.93%)
Mutual labels:  metrics
Telemetry poller
Periodically gather measurements and publish them as Telemetry events
Stars: ✭ 101 (-6.48%)
Mutual labels:  metrics
Pytest Monitor
Pytest plugin for analyzing resource usage during test sessions
Stars: ✭ 105 (-2.78%)
Mutual labels:  quality
Gift
Go Image Filtering Toolkit
Stars: ✭ 1,473 (+1263.89%)
Mutual labels:  image
Bimg
Go package for fast high-level image processing powered by libvips C library
Stars: ✭ 1,394 (+1190.74%)
Mutual labels:  image

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

PyTorch Image Quality Assessment

The piqa 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 only on PyTorch and takes advantage of its efficiency and automatic differentiation.

PIQA is directly inspired from the piq project, but focuses on the conciseness, readability and understandability of its (sub-)modules, such that anyone can easily reuse and/or adapt them to its needs.

However, conciseness should never be at the expense of efficiency; PIQA's implementations are up to 3 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 latest features, you can install it using

pip install git+https://github.com/francois-rozet/piqa

or copy the package directly to your project, with

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

Documentation

The documentation of this package is generated automatically using pdoc.

Getting started

In piqa, each metric is associated to a class, child of torch.nn.Module, which has to be instantiated to evaluate the metric.

import torch

# PSNR
from piqa import PSNR

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

psnr = PSNR()
l = psnr(x, y)

# SSIM
from piqa import SSIM

x = torch.rand(5, 3, 256, 256, requires_grad=True).cuda()
y = torch.rand(5, 3, 256, 256).cuda()

ssim = SSIM().cuda()
l = ssim(x, y)
l.backward()

Like torch.nn built-in components, these classes are based on functional definitions of the metrics, which are less user-friendly, but more versatile.

import torch

from piqa.ssim import ssim
from piqa.utils.functional import gaussian_kernel

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

kernel = gaussian_kernel(11, sigma=1.5).repeat(3, 1, 1)

l = ssim(x, y, kernel=kernel, channel_avg=False)

Metrics

Acronym Class Year Metric
TV TV 1937 Total Variation
PSNR PSNR / Peak Signal-to-Noise Ratio
SSIM SSIM 2004 Structural Similarity
MS-SSIM MS_SSIM 2004 Multi-Scale Structural Similarity
LPIPS LPIPS 2018 Learned Perceptual Image Patch Similarity
GMSD GMSD 2013 Gradient Magnitude Similarity Deviation
MS-GMSD MS_GMSD 2017 Multi-Scale Gradient Magnitude Similarity Deviation
MDSI MDSI 2016 Mean Deviation Similarity Index
HaarPSI HaarPSI 2018 Haar Perceptual Similarity Index

JIT

Most functional components of piqa support PyTorch's JIT, i.e. TorchScript, which is a way to create serializable and optimizable functions from PyTorch code.

By default, jitting is disabled for those components. To enable it, the PIQA_JIT environment variable has to be set to 1. To do so temporarily,

  • UNIX-like bash
export PIQA_JIT=1
  • Windows cmd
set PIQA_JIT=1
  • Microsoft PowerShell
$env:PIQA_JIT=1

Assert

PIQA uses type assertions to raise meaningful messages when an object-oriented component doesn't receive an input of the expected type. This feature eases a lot early prototyping and debugging, but it might hurt a little the performances.

If you need the absolute best performances, the assertions can be disabled with the Python flag -O. For example,

python -O your_awesome_code_using_piqa.py
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].