pyass is a Python implementation of the PEASS (Perceptual Evaluation methods for Audio Source Separation) toolkit. It provides objective measures for evaluating the quality of audio source separation algorithms.
Currently, it implements the PEASS_ObjectiveMeasure function, which calculates:
- OPS: Overall Perceptual Score
- TPS: Target-related Perceptual Score
- IPS: Interference-related Perceptual Score
- APS: Artifact-related Perceptual Score
This project is a port of the original MATLAB implementation.
-
Clone the repository:
git clone https://github.com/yourusername/pyass.git cd pyass -
Create a virtual environment (optional but recommended):
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
You can use pyass as a library in your Python scripts.
from pyass.peass import PEASS_ObjectiveMeasure
# Define paths to your audio files
# originalFiles should be a list containing the target source and interference sources
originalFiles = ['target.wav', 'interf1.wav', 'interf2.wav']
estimateFile = 'estimate.wav'
# Options dictionary
options = {'destDir': './output/'}
# Calculate metrics
results = PEASS_ObjectiveMeasure(originalFiles, estimateFile, options)
# Print results
print(f"OPS: {results['OPS']}")
print(f"TPS: {results['TPS']}")
print(f"IPS: {results['IPS']}")
print(f"APS: {results['APS']}")peass.py: Main entry point containingPEASS_ObjectiveMeasure.gammatone.py: Implementation of the Gammatone filterbank.pemo_filterbank.py: Wrapper for the auditory filterbank.decomposition.py: Least-squares decomposition logic.pemo.py: PEMO-Q metric implementation.mapping.py: Functions to map objective metrics to subjective scales.erbBW.py: Helper for ERB bandwidth calculation.
This code is based on the PEASS toolkit.