Skip to main content

A lightweight library of Frechet Audio Distance calculation.

Project description

Frechet Audio Distance in PyTorch

A lightweight library of Frechet Audio Distance calculation.

Currently, we support embedding from:

Installation

pip install frechet_audio_distance

Demo

from frechet_audio_distance import FrechetAudioDistance

# to use `vggish`
frechet = FrechetAudioDistance(
    model_name="vggish"
    use_pca=False, 
    use_activation=False,
    verbose=False
)
# to use `PANN`
frechet = FrechetAudioDistance(
    model_name="pann"
    use_pca=False, 
    use_activation=False,
    verbose=False
)
fad_score = frechet.score("/path/to/background/set", "/path/to/eval/set")

Result validation

Test 1: Distorted sine waves on vggish (as provided here) [notes]

FAD scores comparison w.r.t. to original implementation in google-research/frechet-audio-distance

baseline vs test1 baseline vs test2
google-research 12.4375 4.7680
frechet_audio_distance 12.7398 4.9815

Test 2: Distorted sine waves on PANN

baseline vs test1 baseline vs test2
frechet_audio_distance 0.000465 0.00008594

References

VGGish in PyTorch: https://github.com/harritaylor/torchvggish

Frechet distance implementation: https://github.com/mseitzer/pytorch-fid

Frechet Audio Distance paper: https://arxiv.org/abs/1812.08466

PANN paper: https://arxiv.org/abs/1912.10211

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

frechet_audio_distance-0.1.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

frechet_audio_distance-0.1.0-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

Details for the file frechet_audio_distance-0.1.0.tar.gz.

File metadata

File hashes

Hashes for frechet_audio_distance-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1b127a6bc673f3f338a5c370d804552c97ac51143bf09c121eb2e90aa530cda7
MD5 3e67fec58ed6465965b6c9cd37948c84
BLAKE2b-256 2ffcd42da3bca83296e208c1268f0280732b5badbd7ce32fb1e637ed6b1a5169

See more details on using hashes here.

File details

Details for the file frechet_audio_distance-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for frechet_audio_distance-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4536843385702bc7b7ba6063aeffd21a53fb6027922f5cf5a23fc88f04eabaef
MD5 25dcbc2568057f4e2ae320b3fd4e56d8
BLAKE2b-256 e52e130218e98aeefd47e7f7a6c22538db315499ee2438a7b4bf59a66fde47ee

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