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.6.tar.gz (98.3 MB view details)

Uploaded Source

Built Distribution

cdpam-0.0.6-py3-none-any.whl (98.3 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cdpam-0.0.6.tar.gz
  • Upload date:
  • Size: 98.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.5.0.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.3

File hashes

Hashes for cdpam-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d1e8d9ba0cf49ecb226b8263e13cbabba9574997f9eefe0dce9683e57a7fe734
MD5 4e1cd7c677c27ab451bc9dcba3a4b1fa
BLAKE2b-256 5976d4be81f695c7269e05a46c046f9af0c8eba920add735f1c50f9843545a29

See more details on using hashes here.

File details

Details for the file cdpam-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: cdpam-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 98.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.5.0.1 requests/2.21.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.3

File hashes

Hashes for cdpam-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 abd860166a55ada94cb653997deed481b518e3a593e9b417a969f99522009eba
MD5 a33bca01997e44714c86f0078abcc27f
BLAKE2b-256 7194a1bb744131083b36f778864bb05338e6e4153e6cde5acf9a6767e50160f6

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