Minimalistic FID and KID implementation. Reference checked against cleanfid
Project description
nicefid
Minimalistic FID and KID implementation. Reference checked against cleanfid. Code is a mix between crowsonkb's implementation and cleanfid.
On Aliased Resizing and Surprising Subtleties in GAN Evaluation
Install
poetry add nicefid
Or, for the old timers:
pip install nicefid
API
nicefid.Features.from_directory(path: Union[str, Path])
nicefid.Features.from_iterator(iterator: Iterator[torch.Tensor]) # NCHW
nicefid.Features.from_path(path: Union[str, Path])
features.save(path: Union[str, Path])
nicefid.compute_fid(features_a, features_b)
nicefid.compute_kid(features_a, features_b)
Usage
Comparing directory with generated images.
import nicefid
features_generated = nicefid.Features.from_iterator(...)
features_real = nicefid.Features.from_directory(...)
fid = nicefid.compute_fid(features_generated, features_real)
kid = nicefid.compute_kid(features_generated, features_real)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nicefid-2.1.1.tar.gz
(7.6 kB
view hashes)
Built Distribution
nicefid-2.1.1-py3-none-any.whl
(10.0 kB
view hashes)