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.4.tar.gz
.
File metadata
- Download URL: cdpam-0.0.4.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 | 06965a9bbffac7e916c13e80e7fc4026936d757440f9077f24f4bffcaa594988 |
|
MD5 | 539e702dc2c392d29fbc51393b432084 |
|
BLAKE2b-256 | ad2e3dbee40f788f6ceccd4879ac828cf781448230d89386c9c91b1c5a0d323d |
File details
Details for the file cdpam-0.0.4-py2-none-any.whl
.
File metadata
- Download URL: cdpam-0.0.4-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 | d0de7f1cca41be0660bef0f886676ed2ff43a0271930e76871fad5ecffc6cf2d |
|
MD5 | dca265db02165fdecd73ebfe650df797 |
|
BLAKE2b-256 | ec6473b253d8a0947103d94494e28b3d65bee7ba71b1af1886634062d6af4413 |