Skip to main content

Frechet Audio Distance evaluation in PyTorch

Project description

fad_pytorch

Original FAD paper (PDF)

Install

pip install fad_pytorch

About

(Intended) Features:

  • runs in parallel on multiple GPUs
  • supports 48kHz sample rates and stereo when possible
  • supports CLAP embeddings, in addition to VGGish and PANN
  • favors ops in PyTorch instead of numpy
  • allows dataset access via WebDataset (over s3://)
  • runs on CPU, CUDA, or MPS

This is designed to be run as 3 command-line scripts in succession. The latter 2 (fad_embed and fad_score) are probably what most people will want:

  1. fad_gen: produces directories of real & fake audio
  2. fad_embed <real_audio_dir> <fake_audio_dir>: produces directories of embeddings of real & fake audio
  3. fad_score <real_emb_dir> <fake_emb_dir>: reads the embeddings & generates FAD score, for real (“$r$”) and fake (“$f$”):

$$ FAD = || \mu_r - \mu_f ||^2 + tr\left(\Sigma_r + \Sigma_f - 2 \sqrt{\Sigma_r \Sigma_f}\right)$$

Related Repos

There are [several] others, but this one is mine. These repos didn’t have all the features I wanted, but I used them for inspiration:

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

fad_pytorch-0.0.2.tar.gz (23.3 kB view details)

Uploaded Source

Built Distribution

fad_pytorch-0.0.2-py3-none-any.whl (25.3 kB view details)

Uploaded Python 3

File details

Details for the file fad_pytorch-0.0.2.tar.gz.

File metadata

  • Download URL: fad_pytorch-0.0.2.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for fad_pytorch-0.0.2.tar.gz
Algorithm Hash digest
SHA256 21a2ecefe46d5b1b67c7260d09e44f225382f2609dca8bfd121113fe7d11b8fa
MD5 b3de32d58580565983f39f45227f4764
BLAKE2b-256 8191971c91c74c60a5543bb5b03ffcce8ba060de7e340849c4afcce370a3841b

See more details on using hashes here.

File details

Details for the file fad_pytorch-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: fad_pytorch-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 25.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for fad_pytorch-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9eaa408dad42cb2801814a5b6298f860ba534209477a7fea8071394d169fc2dd
MD5 be9e78a8a00beb07385f924a1ec33558
BLAKE2b-256 e787e74f23b7ef8336d974bed53514c33eb9e4444fd98ffd28d083bc1644a18f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page