skillfed

pytorch-fid

Package for calculating Frechet Inception Distance (FID) using PyTorch

pytorch-fid v0.3.0 153.2K downloads/30d#10,886 on PyPI3,851
Permissive license DORMANT released

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-fid

uv

uv add pytorch-fid

poetry

poetry add pytorch-fid

Installing 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

License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3

Tags

FID score calculationimage quality evaluation metricgenerative model evaluationinception distance pytorchGAN sample quality assessmentfrechet distance imagesdataset similarity measurement
generative-modelsimage-metricsevaluation

More Artificial Intelligence packages