Skip to main content

Frechet Audio Distance evaluation in PyTorch

Project description

fad_pytorch

Original FAD paper (PDF)

Install

Work in progress. If you’re just finding this repo on GitHub, it may not be ready yet.

pip install fad_pytorch

About

(Intended) Features:

  • runs in parallel on multiple GPUs
  • favors 48kHz sample rates
  • can use CLAP embeddings
  • favors ops in PyTorch instead of numpy
  • allows dataset access via WebDataset (over s3://)
  • operates on CPU, CUDA, or MPS

This is designed to be run as 3 command-line scripts in succession:

  1. fad_gen.py: produces directories of real & fake audio
  2. fad_embed.py: produces directories of embeddings of real & fake audio
  3. fad_score.py: 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.1.tar.gz (12.0 kB view hashes)

Uploaded Source

Built Distribution

fad_pytorch-0.0.1-py3-none-any.whl (11.7 kB view hashes)

Uploaded Python 3

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