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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nicefid-2.1.1.tar.gz.
File metadata
- Download URL: nicefid-2.1.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.8 Linux/5.13.0-51-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f623dbd8a5a3b8498dd97dfbb15927418cbb25360e554a81ff25567b2f65290d
|
|
| MD5 |
99a4c79f3b0e022d81aecda375812d4b
|
|
| BLAKE2b-256 |
4853459fc7e075d2d6539e7bbf2fb465ae15a1edf0d6db76904c75b1673e7ad6
|
File details
Details for the file nicefid-2.1.1-py3-none-any.whl.
File metadata
- Download URL: nicefid-2.1.1-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.13 CPython/3.8.8 Linux/5.13.0-51-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bdcb74c6baece3d424bdb8b0781fa01f6ab6a97aa15da573a333bb4477e922d
|
|
| MD5 |
f80da66c50a680ebc8bf20072cec767a
|
|
| BLAKE2b-256 |
ac52b44940a6e9c01188ee0a63ab3f75679e6e5af5b1bcc57c92b78c5eca6dbd
|