Skip to main content

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

cdpam-0.0.2.tar.gz (98.3 MB view details)

Uploaded Source

Built Distribution

cdpam-0.0.2-py2-none-any.whl (98.3 MB view details)

Uploaded Python 2

File details

Details for the file cdpam-0.0.2.tar.gz.

File metadata

  • Download URL: cdpam-0.0.2.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

Hashes for cdpam-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f024612d39115f6ac8c852966dcb773b2d4ed948ee5a69b05a3bd9a468077358
MD5 1120d663c8d2a1a2dcabfb5a6b7749e1
BLAKE2b-256 49ab6d343c03d5f1d20d9d6db2914df732cfbc32f4e371a8e881b9eabd30f94b

See more details on using hashes here.

File details

Details for the file cdpam-0.0.2-py2-none-any.whl.

File metadata

  • Download URL: cdpam-0.0.2-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

Hashes for cdpam-0.0.2-py2-none-any.whl
Algorithm Hash digest
SHA256 47cce7f3dfe3a1613df4ec7773f45c80d62b4fc69435d7dd32ce506d6165ff89
MD5 8f75c0fa849d83e480c15c683326b9a0
BLAKE2b-256 5c008e2d37c6bf3c67b9a8a151772c5473d1dcc5042e91893deaa111941edbbe

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