--- id: piq version: "0.8.0" license: unclear license_treatment: permissive maintenance: dormant --- # piq — Measures and metrics for image2image tasks. PyTorch. License: permissive · Maintenance: dormant · Downloads: 256.4K/mo ## 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 above — 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 pip install piq uv add piq 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: unspecified - Install friction: low - Maintenance: dormant - Downloads: 256.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags image quality assessment metrics, SSIM PSNR image comparison, perceptual image similarity, image quality loss function, FID inception distance, no-reference image quality, image metrics PyTorch, image-quality, loss-function, metrics [View on SkillFed](https://skillfed.io/packages/piq) · [View on PyPI](https://pypi.org/project/piq/)