A pip package for an improved perceptual audio metric
Project description
Contrastive learning-based Deep Perceptual Audio Metric (CDPAM) [Webpage]
Contrastive Learning For Perceptual Audio Similarity
Pranay Manocha, Zeyu Jin, Richard Zhang, Adam Finkelstein
This is a Pytorch implementation of our new and improved audio perceptual metric. It contains (0) minimal code to run our perceptual metric (CDPAM).
(0) Usage as a loss function
Minimal basic usage as a distance metric
Running the command below takes two audio files as input and gives the perceptual distance between the files. It should return (approx)distance = 0.1696. Some GPU's are non-deterministic, and so the distance could vary in the lsb.
Installing the metric (CDPAM - perceptual audio similarity metric)
pip install cdpam
Using the metric is as simple as:
import cdpam
loss_fn = cdpam.DPAM()
wav_ref = cdpam.load_audio('sample_audio/ref.wav')
wav_out = cdpam.load_audio('sample_audio/2.wav')
dist = loss_fn.forward(wav_ref,wav_out)
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 cdpam-0.0.3.tar.gz
.
File metadata
- Download URL: cdpam-0.0.3.tar.gz
- Upload date:
- Size: 98.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 751de183ec689098a7f96f1c534c3bac62f5cd2b9d8fd167d84308f2ceaed628 |
|
MD5 | 2ea7336f34f1980b8806915afde49570 |
|
BLAKE2b-256 | 2ef96164bc498a31605fcb2137cec617f0d0f1cf1189598efab6b1ddde9ed124 |
File details
Details for the file cdpam-0.0.3-py2-none-any.whl
.
File metadata
- Download URL: cdpam-0.0.3-py2-none-any.whl
- Upload date:
- Size: 98.3 MB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/2.7.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf61e0e1ac6b131a143b24ec344669e22ba5ea5197f0b753de15fee98e262458 |
|
MD5 | 0e3886216113686775463c63ad691f6a |
|
BLAKE2b-256 | 377ff1669304ba3faae37fbe967add230629d185852ad8206cb2bb8298074eca |