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
Arxiv 2020()

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.1.tar.gz (8.2 kB view details)

Uploaded Source

Built Distribution

cdpam-0.0.1-py2-none-any.whl (6.8 kB view details)

Uploaded Python 2

File details

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

File metadata

  • Download URL: cdpam-0.0.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • 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.1.tar.gz
Algorithm Hash digest
SHA256 82936c57c8995f5ad08e654cfa676116f45882f45d3bfb7b86d1862a2f160560
MD5 dcfa7b9bef5130212ea11a1ffcc0465a
BLAKE2b-256 3b502e6fc1909d003dbce614c7f5dd9ab949d7b84e1a5052fa9b63d5cf610760

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cdpam-0.0.1-py2-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • 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.1-py2-none-any.whl
Algorithm Hash digest
SHA256 acbc8f7fa04236248d74804e2d6bc61ddccfc95adbc1795df1b93a55097e14ed
MD5 197e7605b9d3e3cf262002c1dded08f5
BLAKE2b-256 f66a778f0a4e1b7c4396959978c38605e29bc1c532d95a454b4440abc3a6cc9c

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