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:
VGGish
by S. Hershey et al.PANN
by Kong et al..
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
Built Distribution
File details
Details for the file frechet_audio_distance-0.1.0.tar.gz
.
File metadata
- Download URL: frechet_audio_distance-0.1.0.tar.gz
- Upload date:
- Size: 18.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b127a6bc673f3f338a5c370d804552c97ac51143bf09c121eb2e90aa530cda7 |
|
MD5 | 3e67fec58ed6465965b6c9cd37948c84 |
|
BLAKE2b-256 | 2ffcd42da3bca83296e208c1268f0280732b5badbd7ce32fb1e637ed6b1a5169 |
File details
Details for the file frechet_audio_distance-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: frechet_audio_distance-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4536843385702bc7b7ba6063aeffd21a53fb6027922f5cf5a23fc88f04eabaef |
|
MD5 | 25dcbc2568057f4e2ae320b3fd4e56d8 |
|
BLAKE2b-256 | e52e130218e98aeefd47e7f7a6c22538db315499ee2438a7b4bf59a66fde47ee |