Seabass - Python Implementation of the 2f Model
Seabass is a Python implementation of the 2f-model developed by the Internaltional Audio Laboratories Erlangen. It is a model for estimating subjective quality of separated audio source signals, specifically the mean MUSHRA score. The part of this code, particularly the computation of the Model Output Variables are based on the MATLAB implementation, PQEvalAudio, by Peter Kabal. See here for more details about the 2f-model.
Installation
git clone this-repository
cd 2f-model
pip install -e .
Usage
The computation of MOVs requires that the audio signal are scaled to have amplitudes in the range
[-32768, 32767]. By default,seabasshandles this automatically when using the CLI mode orestimate_mean_mushra_score_file, but not always when usingestimate_mean_mushra_score.When reading from files,
soundfilereads the header and normalize it to floating point in the range [-1, 1).seabassthen scales them up by32768.
CLI
seabass --test-path /path/to/test-file.wav \
--ref-path /path/to/reference-file.wav \
--output-path /path/to/output.json
Python
Evaluating directly from files
from seabass.core.models.mms import estimate_mean_mushra_score_file
mms = estimate_mean_mushra_score_file(test_path, ref_path)
print(f"Estimated MMS: {mms:3.2f}")
Evaluating from loaded signals
When using loaded audio, make sure that your audio signals are either
- in the range
[-32768, 32767]and pass the argumentsignal_dtype='int16'to the function, or- in the range
[-1, 1)and pass the argumentsignal_dtype='double'to the function.If your audio signals are in the range
[-1, 1), they will be multiplied by32768to scale them to[-32768, 32768). If this is not what you want, you can scale them yourself before passing them to the function withsignal_dtype='int16'.
import soundfile as sf
from seabass.core.models.mms import estimate_mean_mushra_score
ref_signal, fs_r = sf.read(ref_path, always_2d=True)
test_signal, fs_t = sf.read(test_path, always_2d=True)
# soundfile returns (n_samples, n_channels) but seabass expectes (n_channels, n_samples)
ref_signal = ref_signal.T
test_signal = test_signal.T
assert fs_r == fs_t == 48000
# PEAQ only works with 48 kHz signals
# if your signals are not 48 kHz, resample them
mms = estimate_mean_mushra_score(test_signal, ref_signal)
print(f"Estimated MMS: {mms:3.2f}")
Metadata
Release files for seabass-2f 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| seabass_2f-0.1.0.tar.gz | 20.0 kB | With provenance | Details for seabass_2f-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| seabass_2f-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for seabass_2f-0.1.0-py3-none-any.whl |
Total release size: 43.2 kB
Release files / seabass_2f-0.1.0.tar.gz
| Download URL | seabass_2f-0.1.0.tar.gz |
|---|---|
| Size | 20.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
496c9c0637baddde0f3c27bec3e1055db15285ef49d8e9679c289e3e90d321bd
|
|
BLAKE2b-256 checksum How to use checksums |
6b25249dbf6486d1305b4f0a5f6bd0d98bcd4f5b16b99eca1d71b0ed706d3d17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency logRelease files / seabass_2f-0.1.0-py3-none-any.whl
| Download URL | seabass_2f-0.1.0-py3-none-any.whl |
|---|---|
| Size | 23.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8771c38c0ec684f36ec1dba1763a748ae57d5e258b7e8511676d01d5bc075aec
|
|
BLAKE2b-256 checksum How to use checksums |
5052fe79add9db11092e9370329ce0eb2ce789589610025f32c633fd3dda072f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency logSecurity for seabass-2f 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for seabass_2f-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.