skillfed

piq

Measures and metrics for image2image tasks. PyTorch.

piq v0.8.0 256.4K downloads/30d#8,465 on PyPI1,572
Permissive license DORMANT released

What it is and what it does

PIQ is a library that bundles image quality metrics into a unified, easy-to-use interface. It implements full-reference metrics (SSIM, PSNR, LPIPS, etc.) that compare pairs of images, no-reference metrics (BRISQUE, CLIP-IQA) that assess single images, and distribution-based metrics (FID, IS, KID) that compare feature distributions from image sets. Most metrics can be backpropagated, making them suitable as loss functions for model training.

The library is built on pure PyTorch with minimal additional dependencies, provides extensive input validation to prevent crashes during training, and supports GPU computation. It evolved from an earlier package called PhotoSynthesis.Metrics and includes code for benchmarking metrics against standard datasets like TID2013 and KADID10k.

Use it for:

  • Training image generation or enhancement models using perceptual loss functions like LPIPS or SSIM.
  • Evaluating generative model quality with FID or Inception Score on image distributions.
  • Comparing image restoration or super-resolution outputs against reference images.
  • Assessing blind image quality using BRISQUE or CLIP-IQA on single images.
  • Benchmarking image processing pipelines against standard quality metrics on common datasets.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PIQ provides a collection of image quality metrics and measures—both full-reference (comparing two images) and no-reference (assessing a single image)—implemented as PyTorch modules that can be used as loss functions or evaluated independently.

Yes, if you need image quality metrics. The library is well-established (1572 GitHub stars, 256419 monthly downloads), permissively licensed, and has low install friction. The dormant maintenance status is not a blocker for stable metric implementations, but verify that the specific metrics you need are present and that you do not require active bug fixes or new features. No known vulnerabilities.

Install

piq on PyPI

pip

pip install piq

uv

uv add piq

poetry

poetry add piq

Installing piq

Before you install

Low friction: pure Python wheel with a single runtime dependency (torchvision). Repository is dormant (last commit May 2024, no release since July 2023), but archived status is false, suggesting maintenance is paused rather than abandoned.

License in practice

Licensed under Apache Software License (permissive). You can use, modify, and distribute the package freely in commercial or private projects without restriction, though you must include the license notice.

Quickstart

pip install piq

from piq import ssim, SSIMLoss

ssim_index = ssim(x, y, data_range=1.)

loss = SSIMLoss(data_range=1.)
output = loss(x, y)
output.backward()

Requires torchvision as a runtime dependency; GPU acceleration is optional but available.

Verify before relying

  • Whether the package works reliably with Python versions beyond 3.10 (description mentions 3.7-3.10 support).
  • Current maintenance status: whether dormancy indicates the package is stable or effectively unmaintained.
  • Specific metrics available and their performance on standard benchmarks.

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 1 — torchvision
Maintenance dormant — 1,137 days since the last release
Last repo commit
First released
Downloads 256,419/month — #8,465 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: piq-0.8.0-py3-none-any.whl

License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

image quality assessment metricsSSIM PSNR image comparisonperceptual image similarityimage quality loss functionFID inception distanceno-reference image qualityimage metrics PyTorch
image-qualityloss-functionmetrics

More Artificial Intelligence packages