Whisper-based non-intrusive speech quality assessment
Project description
whisqa: a PyPI package for the WhiSQA Non-Intrusive Speech Quality Prediction Model
This project is a fork of the original WhiSQA project repackaged for PyPI.
WhiSQA is a non-intrusive MOS (ITU-T P.835) speech quality predictor.
Original repo: https://github.com/leto19/WhiSQA
Improvements
pip install whisqa— fully installable package; no manual cloning or dependency wrangling.- Bundled weights — the frozen Whisper encoder weights (~350 MB per checkpoint) are stripped down to head-only files of 11 MB and 13 MB that ship inside the wheel. The strip script is kept in the repo for full reproducibility.
- Flexible input —
predict()accepts file paths, NumPy arrays, and Torch tensors, making it easy to integrate into existing pipelines without writing audio to disk. - Auto-resampling — any sample rate is accepted; audio is resampled to 16 kHz automatically with a suppressible warning.
- CLI — score a file from the terminal with
whisqa speech.wav. - Simple API —
predict()andload_model()with type hints, docstrings, and unit tests.
Install
pip install whisqa
First-run note:
load_model()downloadsopenai/whisper-small(~240 MB) from HuggingFace Hub and caches it in~/.cache/huggingface/. The WhiSQA head weights ship inside the package and require no download.
Usage
import whisqa
# File path — WAV or any format supported by libsndfile
whisqa.predict("speech.wav")
# → {'mos': 3.82}
# NumPy array
import numpy as np
whisqa.predict(np.zeros(16000, dtype=np.float32), sample_rate=16000)
# Torch tensor — drop straight in from your existing pipeline
import torch
whisqa.predict(torch.zeros(1, 16000), sample_rate=16000)
# All five P.835 dimensions
whisqa.predict("speech.wav", model_type="multi")
# → {'mos': 3.82, 'noisiness': 4.10, 'coloration': 3.55, 'discontinuity': 4.20, 'loudness': 3.90}
# Efficient repeated inference — load once, score many
model = whisqa.load_model("single")
for f in my_files:
print(whisqa.predict(f, model=model))
# CLI
whisqa speech.wav
whisqa speech.wav --model multi
whisqa speech.wav --no-warn-resample
Citation
If you use WhiSQA in your work, please cite the original authors:
@inproceedings{close2025whisqa,
title = {{WhiSQA}: Non-Intrusive Speech Quality Prediction Using {Whisper} Encoder Features},
author = {Close, George and Hong, Kris Y. and Hain, Thomas and Goetze, Stefan},
booktitle = {Speech and Computer -- 27th International Conference, {SPECOM} 2025,
Szeged, Hungary, October 13--15, 2025, Proceedings, Part {I}},
editor = {Karpov, Alexey and Gosztolya, G{\'a}bor},
series = {Lecture Notes in Computer Science},
volume = {16187},
pages = {39--51},
publisher = {Springer},
year = {2025},
doi = {10.1007/978-3-032-07956-5_3},
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file whisqa-0.1.4.tar.gz.
File metadata
- Download URL: whisqa-0.1.4.tar.gz
- Upload date:
- Size: 23.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f882223a649fa6f46ea1bb4f0af3b2821222c02abfa99ceb67d74dfc4340b72e
|
|
| MD5 |
40fd5bbe18088ce43b19076261e83168
|
|
| BLAKE2b-256 |
ef9f1682837f890dc6c8f56aa0863dcfe4a3acfa584cbdb7bb8c329e9f930e00
|
Provenance
The following attestation bundles were made for whisqa-0.1.4.tar.gz:
Publisher:
publish.yml on jwr1995/whisqa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whisqa-0.1.4.tar.gz -
Subject digest:
f882223a649fa6f46ea1bb4f0af3b2821222c02abfa99ceb67d74dfc4340b72e - Sigstore transparency entry: 1519746015
- Sigstore integration time:
-
Permalink:
jwr1995/whisqa@a996ed257d44c09ffe3b649470781e8010e02e64 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/jwr1995
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a996ed257d44c09ffe3b649470781e8010e02e64 -
Trigger Event:
push
-
Statement type:
File details
Details for the file whisqa-0.1.4-py3-none-any.whl.
File metadata
- Download URL: whisqa-0.1.4-py3-none-any.whl
- Upload date:
- Size: 22.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2506a2ab3d7a8f07a21f7c08bc1dc06ef1e312edbeef1427f63935ce25d70407
|
|
| MD5 |
bdd208cf4181e37fcc4003b5c4ecf2f3
|
|
| BLAKE2b-256 |
cd2f8cb0011b4c1f541884c49210c85ad353754a94149312060b564cdf648f02
|
Provenance
The following attestation bundles were made for whisqa-0.1.4-py3-none-any.whl:
Publisher:
publish.yml on jwr1995/whisqa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
whisqa-0.1.4-py3-none-any.whl -
Subject digest:
2506a2ab3d7a8f07a21f7c08bc1dc06ef1e312edbeef1427f63935ce25d70407 - Sigstore transparency entry: 1519746026
- Sigstore integration time:
-
Permalink:
jwr1995/whisqa@a996ed257d44c09ffe3b649470781e8010e02e64 -
Branch / Tag:
refs/tags/v0.1.4 - Owner: https://github.com/jwr1995
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a996ed257d44c09ffe3b649470781e8010e02e64 -
Trigger Event:
push
-
Statement type: