--- id: clean-fid version: "0.1.35" license: unclear license_treatment: permissive maintenance: aging --- # clean-fid — FID calculation in PyTorch with proper image resizing and quantization steps License: permissive · Maintenance: aging · Downloads: 407.0K/mo ## What it is and what it does Clean-fid is a library for computing FID and KID metrics used to evaluate the quality of images generated by generative models like GANs. The core problem it solves is that different implementations of FID use different image resizing and quantization methods, leading to inconsistent scores across papers and groups. This library standardizes those operations—particularly addressing aliasing issues in resizing functions and JPEG compression effects—so that FID scores become comparable. The package wraps PyTorch and provides a simple API to compute FID between two image folders, between a folder and precomputed dataset statistics (for datasets like CIFAR-10, FFHQ, and LSUN), or between a generative function and precomputed statistics. It also supports KID computation and CLIP-based FID variants. Its main dependencies are torch, torchvision, numpy, scipy, pillow, requests, and tqdm. Use it for: - Evaluate a trained GAN or diffusion model against standard benchmarks like FFHQ or CIFAR-10 using precomputed statistics. - Compare FID scores across different generative models or training runs with consistent resizing and quantization. - Compute KID scores for few-shot generation tasks on smaller datasets like AFHQ or BreCaHAD. - Debug image generation quality by computing FID between generated and real image folders with controlled resizing methods. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Computes Fréchet Inception Distance (FID) and Kernel Inception Distance (KID) scores for evaluating generative models, with corrected image resizing and quantization to ensure consistent results across implementations. Yes, if you are actively evaluating generative models and need reproducible FID/KID scores. The library solves a real standardization problem in GAN evaluation. However, consider that maintenance is aging (last release December 2022); verify compatibility with your current PyTorch version before relying on it for new research, and monitor the repository for updates or consider alternatives if critical bugs emerge. ## Install pip install clean-fid uv add clean-fid poetry add clean-fid ## Installing clean-fid Before you install: Low install friction with a pure Python wheel. Maintenance is aging—last release was 2022-12-18 and the repository has not been updated since 2025-08-02, though it remains unarchived and has moderate community interest (1168 stars). License in practice: BSD License (permissive) allows commercial and private use with minimal restrictions. Quickstart: pip install clean-fid from cleanfid import fid score = fid.compute_fid(fdir1, fdir2) # or with precomputed dataset statistics: score = fid.compute_fid(fdir1, dataset_name="FFHQ", dataset_res=1024) Requires torch, torchvision, and their system dependencies; no explicit Python version constraint stated in the package metadata. Verify before relying: - Whether the package works with recent PyTorch versions given the aging maintenance status. - Whether precomputed dataset statistics are still available and up-to-date. - Compatibility with modern Python versions beyond what the classifier 'Programming Language :: Python :: 3' implies. ## Package facts - License: not declared (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 407.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags FID score calculation, generative model evaluation, image quality metrics, GAN evaluation, inception distance, gan-evaluation, image-metrics, generative-models [View on SkillFed](https://skillfed.io/packages/clean-fid) · [View on PyPI](https://pypi.org/project/clean-fid/)