pytorch-fid
Package for calculating Frechet Inception Distance (FID) using PyTorch
What it is and what it does
pytorch-fid is a PyTorch implementation of the Fréchet Inception Distance metric, originally developed to evaluate generative model quality by measuring statistical distance between real and generated image distributions. It computes FID by fitting Gaussians to feature representations extracted from the Inception network and calculating the Fréchet distance between them.
The package provides a command-line interface to compute FID scores between two image folders, with options to use different Inception layers (64, 192, 768, or 2048 dimensions) and GPU acceleration. It can also pre-compute and cache dataset statistics as .npz files for repeated comparisons. The weights and model match the official implementation, though results may differ slightly due to image interpolation and backend differences.
Use it for:
- Evaluate generative adversarial network (GAN) sample quality during training or model comparison
- Measure similarity between real and synthetic image datasets for validation
- Pre-compute and cache statistics from a reference dataset to benchmark multiple models against it
- Compare image generation models using a standardized metric that correlates with human visual quality judgment
- Use lower-dimensional Inception features when comparing datasets with fewer than 2048 images
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Computes Fréchet Inception Distance (FID), a metric for measuring similarity between two image datasets using PyTorch and the Inception network.
Yes, if you need FID evaluation for generative models in PyTorch. The package is stable, permissively licensed, and has low install friction. However, maintenance is dormant (last release January 2023); verify current compatibility with your PyTorch version first. Results differ slightly from the original implementation, so check whether exact reproducibility matters for your use case.
Install
pytorch-fid on PyPI
pip
pip install pytorch-fiduv
uv add pytorch-fidpoetry
poetry add pytorch-fidInstalling pytorch-fid
Before you install
Low friction install with standard dependencies. Dormant maintenance status (last release January 2023) means no active development, but the package is stable.
License in practice
Licensed under Apache License 2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install pytorch-fid
python -m pytorch_fid path/to/dataset1 path/to/dataset2
# Or with GPU acceleration:
python -m pytorch_fid --device cuda:0 path/to/dataset1 path/to/dataset2
Requires PyTorch and torchvision installed; GPU acceleration requires CUDA-capable hardware.
Verify before relying
- Whether results remain comparable to official TensorFlow implementation given reported interpolation differences
- Current compatibility with recent PyTorch and torchvision versions beyond requires_python >=3.5
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.5) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — numpy, pillow, scipy, torch, torchvision |
| Maintenance | dormant — 1,317 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 153,171/month — #10,886 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pytorch_fid-0.3.0-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
clean-fidComputes Fréchet Inception Distance (FID) and…
permissive · top 15,000 on PyPI
piqPIQ provides a collection of image quality…
permissive · top 15,000 on PyPI
lpipsComputes perceptual similarity between image…
permissive · top 5,000 on PyPI
tomesdSpeeds up Stable Diffusion image generation by…
permissive · top 15,000 on PyPI
facenet-pytorchProvides pretrained PyTorch models for face…
permissive · top 15,000 on PyPI
pyiqaPyIQA provides a PyTorch-based toolbox for…
noncommercial · top 15,000 on PyPI
pretrainedmodelsProvides a unified interface to load pretrained…
permissive · top 15,000 on PyPI
effdetPyTorch implementation of EfficientDet object…
permissive · top 15,000 on PyPI
pytorchcvProvides a collection of pretrained computer…
unclear · top 15,000 on PyPI