lpips
LPIPS Similarity metric
Decision gist · record as of 2026-08-14
Yes, if you need a perceptual image similarity metric for computer vision tasks. The package is stable, has low dependencies, and is widely used (1.2M monthly downloads). However, it is dormant—no active maintenance since 2021—so expect no bug fixes or updates. Install it for evaluation or loss functions in image generation, super-resolution, or quality assessment workflows where perceptual alignment matters more than pixel-level similarity.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires PyTorch 1.0+ and torchvision; images must be PyTorch tensors with shape (N, 3, H, W) normalized to [-1, 1] range.
- Low installation friction with a pure Python wheel.
- The package is dormant (last release August 2021, last commit July 2024) but remains functional; it depends on stable, widely-used libraries (torch, torchvision, numpy, scipy, tqdm).
License · maintenance · safety
permissive license (permissive) — Permissive BSD license allows commercial and private use with minimal restrictions.
last release 2021-08-25 (1815 days) · last repo commit 2024-07-02 · 4,268 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,205,472 downloads/mo, #4,224 on PyPI
Alternatives
Verify before relying
pip install lpips
import lpips
import torch
loss_fn = lpips.LPIPS(net='alex')
img0 = torch.zeros(1, 3, 64, 64) # RGB, normalized to [-1, 1]
img1 = torch.zeros(1, 3, 64, 64)
distance = loss_fn(img0, img1)- Whether pre-trained model weights are downloaded automatically on first use or require manual setup
- Memory requirements for different network variants (SqueezeNet, AlexNet, VGG) mentioned in the description
- GPU memory constraints when processing large batches or high-resolution images
What it is and what it does
LPIPS is a learned perceptual similarity metric that measures how different two images are by comparing their deep neural network feature representations. Rather than using pixel-level differences, it leverages the fact that intermediate activations from pre-trained networks (AlexNet, VGG, or SqueezeNet) correlate well with human perceptual judgments. The package provides three network variants with optional linear calibration layers trained on the Berkeley-Adobe Perceptual Patch Similarity (BAPPS) dataset.
You use it by instantiating a loss function object with your chosen network, then calling it on pairs of PyTorch tensors (images normalized to [-1, 1] range). It returns a scalar or batch of distances where lower values mean more similar images. The metric can be used for evaluation (comparing generated images to references) or as a differentiable loss function for optimization tasks like image generation, super-resolution, or deblurring.
Use it for
- Evaluate image generation quality by measuring perceptual distance between generated and reference images
- Use as a loss function during training of image-to-image translation or super-resolution models
- Compare different image processing algorithms (denoising, deblurring, color correction) against human perception
- Benchmark perceptual quality of compressed or distorted images in computer vision pipelines
- Optimize image synthesis tasks by backpropagating through the metric to guide model training
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need a perceptual image similarity metric for computer vision tasks.
The package is stable, has low dependencies, and is widely used (1.2M monthly downloads). However, it is dormant—no active maintenance since 2021—so expect no bug fixes or updates. Install it for evaluation or loss functions in image generation, super-resolution, or quality assessment workflows where perceptual alignment matters more than pixel-level similarity.
Install
lpips on PyPI
Before you install
Low installation friction with a pure Python wheel. The package is dormant (last release August 2021, last commit July 2024) but remains functional; it depends on stable, widely-used libraries (torch, torchvision, numpy, scipy, tqdm).
Requires PyTorch 1.0+ and torchvision; images must be PyTorch tensors with shape (N, 3, H, W) normalized to [-1, 1] range.
License in practice
Permissive BSD license allows commercial and private use with minimal restrictions.
Quickstart
pip install lpips
import lpips
import torch
loss_fn = lpips.LPIPS(net='alex')
img0 = torch.zeros(1, 3, 64, 64) # RGB, normalized to [-1, 1]
img1 = torch.zeros(1, 3, 64, 64)
distance = loss_fn(img0, img1)
Verify before relying
- Whether pre-trained model weights are downloaded automatically on first use or require manual setup
- Memory requirements for different network variants (SqueezeNet, AlexNet, VGG) mentioned in the description
- GPU memory constraints when processing large batches or high-resolution images
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 5 packagestorchtorchvisionnumpyscipytqdm |
| Maintenance | Dormant 1,815 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,205,472 / month, #4,224 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: lpips-0.1.4-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “perceptual image similarity metric”
- lpipsComputes perceptual similarity between image pairs using deep neural…
- pytorch-msssimComputes fast, differentiable SSIM and MS-SSIM metrics for PyTorch…
- ImageHashImageHash computes perceptual fingerprints of images using multiple…
Give your agent the search over MCP, or paste the wish link into any chat.
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to call 100+ LLM providers (OpenAI, Anthropic, Gemini, Bedrock, Azure, and others) using OpenAI-compatible API format, available as both a Python SDK and a self-hosted AI Gateway proxy server.
Install it if you need to work with multiple LLM providers or want to centralize LLM routing in your organization.
Client library and CLI tool for downloading, uploading, and managing models, datasets, and repositories on the Hugging Face Hub platform.
Install it if you work with Hugging Face Hub models or datasets.
LangChain provides a framework for building agents and LLM-powered applications by composing language models, tools, and memory through a unified API that abstracts over multiple model providers.
hf-xet provides chunk-based deduplication and efficient file transfer for the Hugging Face Hub, enabling faster uploads and downloads of large files with local disk caching.
Tokenizers converts raw text into token sequences for NLP models, with support for training custom vocabularies and using pre-built tokenizers (BPE, WordPiece) optimized for speed via Rust.
Transformers provides a unified framework for loading, fine-tuning, and running state-of-the-art pretrained models across text, vision, audio, video, and multimodal tasks using PyTorch, JAX, or TensorFlow.
Install it if you need to run or train any transformer-based model for NLP, vision, audio, or multimodal tasks.
See also pixelhog · image-similarity-measures · pytorch-metric-learning · pyiqa · imagededup · piq · pytorch-fid · clip-benchmark · pytorch-msssim · ImageHash