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.
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:Noption.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
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
Install the package with the command below.
pip install pytorch-fidRun the command below.
python -m pytorch_fid path/to/dataset1 path/to/dataset2For GPU evaluation, add
--device cuda:N, replacingNwith 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.
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
Install the package with the command below.
pip install pytorch-fidRun the command below.
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.
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.

