Skip to main content

Package for fast computation of BSS Eval metrics for source separation

Project description

fast_bss_eval

PyPI version Documentation Status black tests codecov

Do you have a zillion BSS audio files to process and it is taking days ? Is your simulation never ending ?

Fear no more! fast_bss_eval is here to help you!

fast_bss_eval is a fast implementation of the bss_eval metrics for the evaluation of blind source separation. Our implementation of the bss_eval metrics has the following advantages compared to other existing ones.

  • seamlessly works with both numpy arrays and pytorch tensors
  • very fast
  • can be even faster by using an iterative solver (add use_cg_iter=10 option to the function call)
  • differentiable via pytorch
  • can run on GPU via pytorch

Author

Quick Start

Install

# from pypi
pip install fast-bss-eval

# or from source
git clone https://github.com/fakufaku/fast_bss_eval
cd fast_bss_eval
pip install -e .

Use

Assuming you have multichannel signals for the estmated and reference sources stored in wav format files names my_estimate_file.wav and my_reference_file.wav, respectively, you can quickly evaluate the bss_eval metrics as follows.

from scipy.io import wavfile
import fast_bss_eval

# open the files, we assume the sampling rate is known
# to be the same
fs, ref = wavfile.read("my_reference_file.wav")
_, est = wavfile.read("my_estimate_file.wav")

# compute the metrics
sdr, sir, sar, perm = fast_bss_eval.bss_eval_sources(ref.T, est.T)

Benchmark

This package is significantly faster than other packages that also allow to compute bss_eval metrics such as mir_eval or sigsep/bsseval. We did a benchmark using numpy/torch, single/double precision floating point arithmetic (fp32/fp64), and using either Gaussian elimination or a conjugate gradient descent (solve/CGD10).

Citation

If you use this package in your own research, please cite our paper describing it.

@misc{scheibler_sdr_2021,
  title={SDR --- Medium Rare with Fast Computations},
  author={Robin Scheibler},
  year={2021},
  eprint={2110.06440},
  archivePrefix={arXiv},
  primaryClass={eess.AS}
}

License

2021 (c) Robin Scheibler, LINE Corporation

All of this code is released under MIT License with the exception of fast_bss_eval/torch/hungarian.py which is under 3-clause BSD License.

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

fast_bss_eval-0.1.4.tar.gz (33.7 kB view details)

Uploaded Source

File details

Details for the file fast_bss_eval-0.1.4.tar.gz.

File metadata

  • Download URL: fast_bss_eval-0.1.4.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for fast_bss_eval-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b9b1307577f77128dda9efb8310ff4d4ca39afc0fccce0c62640a1e34f9add13
MD5 352577bbb110bd438abadd26d0410fb3
BLAKE2b-256 2cdf9095cedbb89aa308c34b692f65fb9f4405c7fea735feeea8ce3148a66f43

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