OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Evaluation & Observability

Pytorch Fid

Pytorch Fid is a Python and PyTorch implementation of Fréchet Inception Distance (FID), a metric that compares image datasets using feature representations from an Inception network. Its command-line interface scores two image folders and can save dataset statistics for reuse.

Independent OpenViST project profile, based on linked sources.

Pytorch Fid — OpenViST project profile in AI Evaluation & Observability.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when you need a command-line FID comparison between image folders or want to save reference-dataset statistics for repeated comparisons.

Who it is for

  • Researchers evaluating generative-model image samples against reference datasets.
  • Developers adding FID scoring to image-generation evaluation workflows.

Documented uses

  • Compute an FID score between two image datasets.
  • Compare generated-image folders with reference images.
  • Reuse saved statistics from a reference dataset across repeated model evaluations.
  • Select an Inception feature dimension for an evaluation.
Before you choose

Requirements & limits

The public GitHub repository provides the implementation under the Apache License 2.0.

  • The default feature dimension is 2048; alternatives are 64, 192 and 768.
  • Changing feature dimensions changes score magnitude, making scores across dimensions incomparable; lower-dimensional results may also correlate less well with visual quality.
  • Results may differ slightly from the TensorFlow implementation, so exact comparison with published scores may require considering that implementation.
  • GPU evaluation is available through the --device cuda:N option.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Compute FID between two image folders

Compare two image datasets using the command-line interface.

Before you start

  • Python 3
  • PyTorch, torchvision, Pillow, NumPy and SciPy
  • Images from each dataset stored in a separate folder

Steps

  1. Install the package with the command below.

    Documented command
    pip install pytorch-fid
  2. Run the command below.

    Documented command
    python -m pytorch_fid path/to/dataset1 path/to/dataset2
  3. For GPU evaluation, add --device cuda:N, replacing N with the GPU index.

Expected outcome

The command computes an FID score for the two image datasets.

Guide limitations

  • FID values can differ slightly from the original TensorFlow implementation because of image interpolation and library-backend differences.
  • Scores from different feature dimensions are not directly comparable.
Source-based practical guide

Save reference-dataset statistics for reuse

Create a compatible statistics archive so later comparisons can use it instead of the original reference folder.

Before you start

  • Python 3
  • PyTorch, torchvision, Pillow, NumPy and SciPy
  • A reference image folder and a destination path for the archive

Steps

  1. Install the package with the command below.

    Documented command
    pip install pytorch-fid
  2. Run the command below.

    Documented command
    python -m pytorch_fid --save-stats path/to/dataset path/to/outputfile

Expected outcome

The command creates a compatible `.npz` archive that can be used in place of the dataset path in later comparisons.

Guide limitations

  • The archive-generation command is documented; later comparison steps are not included in this guide.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
15 October 2026
Original website title
mseitzer/pytorch-fid · Official homepage title · retained in its source language

Related options

Official TensorFlow FID implementation (bioinf-jku/TTUR) — The project identifies it as the original TensorFlow implementation and recommends considering it when exact comparability with published FID results is required.