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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cdpam-0.0.5.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.5.tar.gz
Algorithm Hash digest
SHA256 8a8810fae64bae2514817637201b3bc49c268fa3f87a9352cbd40b86531c5b7e
MD5 49a848e89fa3b3c46f8632744761e862
BLAKE2b-256 5853c06943a207a9fae95eda58ffd6565ab9cb8049d5cee9bf9875f965b9d1b1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cdpam-0.0.5-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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 13fed3e5cb4f48f52ef743a9fd41b7cb5882690d90973b1e75a88d9c1974a248
MD5 a27db6dd8166da0a6cd1e6ca481f8a60
BLAKE2b-256 9103421af89ac7aaed00d8de7e1297c47daf401e2d3867dc4048057da2f5307e

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