This repository is a fork of the original UTMOS v2 project, maintained by the Hyperion organization. It packages the original implementation under the distribution name
hyperion-utmosv2and adjusts dependency constraints so it can coexist with Hyperion. It is not an official UTMOS release and is not necessarily endorsed by the original authors.
The original utmosv2 Python import name is intentionally preserved:
import utmosv2
The original MIT license, copyright notice, paper citation, and attribution are preserved in this fork.
UTMOSv2: UTokyo-SaruLab MOS Prediction System
🎤✨ Original project's official implementation ✨🎤
“The T05 System for The VoiceMOS Challenge 2024:
Transfer Learning from Deep Image Classifier to Naturalness MOS Prediction of High-Quality Synthetic Speech”
🏅🎉 accepted by IEEE Spoken Language Technology Workshop (SLT) 2024. 🎉🏅
ꔫ・-・ꔫ・-・ꔫ・-・ꔫ・-・ꔫ・-・ꔫ・-・ꔫ・-・ꔫ
✨ UTMOSv2 achieved 1st place in 7 out of 16 metrics ✨
✨🏆 and 2nd place in the remaining 9 metrics 🏆✨
✨ in the VoiceMOS Challenge 2024 Track1! ✨
🚀 Quick Prediction
✨ You can easily use the pretrained UTMOSv2 model!
🛠️ Using in your Python code 🛠️
✨ allowing you to quickly create models and make predictions with minimal effort!! ✨
If you want to make predictions using the UTMOSv2 library, follow these steps:
-
Install the Hyperion-maintained package from PyPI
pip install hyperion-utmosv2
This package can be installed in the same environment as Hyperion. Install Hyperion according to its own documentation, then install
hyperion-utmosv2in that environment. -
Make predictions
-
To predict the MOS of a tensor or array already loaded in memory:
import utmosv2 model = utmosv2.create_model(pretrained=True) # data: torch.Tensor or np.ndarray with shape (batch_size, sequence_length) or (sequence_length,) # sr: Sampling rate of the input audio data. If not provided, it defaults to 16000 Hz. mos = model.predict( data=data, sr=16000 ) # Returns a torch.Tensor or np.ndarray with shape (batch_size,) or (1,)
-
To predict the MOS of a single
.wavfile:import utmosv2 model = utmosv2.create_model(pretrained=True) mos = model.predict(input_path="/path/to/wav/file.wav") # Returns a float value
-
To predict the MOS of all
.wavfiles in a folder:import utmosv2 model = utmosv2.create_model(pretrained=True) mos = model.predict( input_dir="/path/to/wav/dir/" ) # Returns a list of dicts with 'file_path' and 'predicted_mos' keys
-
[!NOTE] When
datais provided,input_pathandinput_dirare ignored.
[!NOTE] Either
input_pathorinput_dirmust be specified whendataisNone, but not both.
📜 Using the inference script 📜
If you want to make predictions using the inference script, follow these steps:
-
Clone this repository and navigate to UTMOSv2 folder
git clone https://github.com/sarulab-speech/UTMOSv2.git cd UTMOSv2
-
Install Package
pip install -e '.[optional]'
-
Make predictions
-
To predict the MOS of a single
.wavfile:python inference.py --input_path /path/to/wav/file.wav --out_path /path/to/output/file.csv
-
To predict the MOS of all
.wavfiles in a folder:python inference.py --input_dir /path/to/wav/dir/ --out_path /path/to/output/file.csv
-
[!NOTE] If you are using zsh, quote the extras specifier like this:
pip install -e '.[optional]'
[!TIP] If
--out_pathis not specified, the prediction results will be output to the standard output. This is particularly useful when the number of files to be predicted is small.
[!NOTE] Either
--input_pathor--input_dirmust be specified, but not both.
[!NOTE] These methods provide quick and simple predictions. For more accurate predictions and detailed usage of the inference script, please refer to the inference guide.
🤗 You can try a simple demonstration on Hugging Face Space:
Model files, external assets, and limitations
The Python package does not bundle model checkpoints, datasets, caches, or audio files. create_model(pretrained=True) downloads the pretrained checkpoint at runtime from the upstream UTMOSv2 Hugging Face repository and stores it in the local UTMOSv2 cache; network access is therefore required for the first pretrained-model use. A custom checkpoint can be supplied with checkpoint_path. The package also relies on external pretrained transformer assets when the selected configuration uses them.
Dataset licenses and usage terms vary by dataset; see docs/datasets.md and comply with each dataset's terms. The code is distributed under the MIT license in LICENSE, while pretrained weights, model cards, datasets, and third-party assets may have separate terms. Review those terms before redistribution or commercial use. Predictions are model estimates and may not be suitable as the sole basis for safety-critical, compliance, or other high-stakes decisions.
Publishing and release setup
The distribution name is hyperion-utmosv2; the import name remains utmosv2. The repository's release workflow builds and validates source and wheel distributions, then publishes only when a GitHub Release is published using PyPI Trusted Publishing/OIDC.
Before the first release:
-
Verify the PyPI project page is unavailable or belongs to this organization. If the name is taken, choose a different distribution name and update
pyproject.toml, this README, and the Trusted Publisher configuration. -
On PyPI, add a Trusted Publisher for owner
hyperion-ml, repositoryUTMOSv2, workflow.github/workflows/python-publish.yml, and environmentpypi. -
In GitHub, create the
pypienvironment. Require approval from an appropriate maintainer and restrict deployments to the release workflow or protected release rules as appropriate for the organization. Do not add a PyPI API token; the workflow uses OIDC. -
Merge the workflow to the repository's default
mainbranch. Create a GitHub Release with a new tag (for examplev1.3.1) and publish the release. A draft or prerelease does not trigger this workflow. -
Verify the files, metadata, and installation from PyPI:
python -m pip install --upgrade hyperion-utmosv2 python -c "import utmosv2; print(utmosv2.__version__)"
Also inspect the PyPI project page and
python -m pip show hyperion-utmosv2. Usepython -m buildandtwine check dist/*before release.
If hyperion-utmosv2 is already registered, do not attempt to claim or overwrite it. Confirm ownership and contact the current owner if appropriate, or select an available name and update all package and publishing references consistently.
⚒️ Train UTMOSv2 Yourself
If you want to train UTMOSv2 yourself, please refer to the training guide. To reproduce the training as described in the paper or used in the competition, please refer to this document.
📂 Used Datasets
Details of the datasets used in this project can be found in the datasets documentation.
🔖 Citation
If you find UTMOSv2 useful in your research, please cite the following paper:
@inproceedings{baba2024utmosv2,
title = {The T05 System for The {V}oice{MOS} {C}hallenge 2024: Transfer Learning from Deep Image Classifier to Naturalness {MOS} Prediction of High-Quality Synthetic Speech},
author = {Baba, Kaito and Nakata, Wataru and Saito, Yuki and Saruwatari, Hiroshi},
booktitle = {IEEE Spoken Language Technology Workshop (SLT)},
year = {2024},
pages = {818--824},
doi = {10.1109/SLT61566.2024.10832315},
}
:octocat: GitHub Star History
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 hyperion_utmosv2-1.3.1.tar.gz.
File metadata
- Download URL: hyperion_utmosv2-1.3.1.tar.gz
- Upload date:
- Size: 35.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b915327a397b443b4fae7bb8ab82fa471d8f7fff4b49add67a4db2fdbec6c0e4
|
|
| MD5 |
aee7982eb52b5b9bc7bf8e5e4aad6639
|
|
| BLAKE2b-256 |
d854fd34c8bc93f0fe8838495c7ec4c7701fec9ba6c613fd9ae9a02a594fc88d
|
Provenance
The following attestation bundles were made for hyperion_utmosv2-1.3.1.tar.gz:
Publisher:
python-publish.yml on hyperion-ml/UTMOSv2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyperion_utmosv2-1.3.1.tar.gz -
Subject digest:
b915327a397b443b4fae7bb8ab82fa471d8f7fff4b49add67a4db2fdbec6c0e4 - Sigstore transparency entry: 2553570913
- Sigstore integration time:
-
Permalink:
hyperion-ml/UTMOSv2@59b166da5290b83c92fd953ff327accbe43555e1 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/hyperion-ml
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@59b166da5290b83c92fd953ff327accbe43555e1 -
Trigger Event:
release
-
Statement type:
File details
Details for the file hyperion_utmosv2-1.3.1-py3-none-any.whl.
File metadata
- Download URL: hyperion_utmosv2-1.3.1-py3-none-any.whl
- Upload date:
- Size: 80.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8f306c4108fd8273ee5975ec12e6180ac9e4e45f9b541a6a55d7724fd39b322
|
|
| MD5 |
523596a38b48761dee2ce2b42a7e2128
|
|
| BLAKE2b-256 |
49061e8c806f3cfcc749c9d54dfc7df052533371ba8bcac41793c9bb26eca9b4
|
Provenance
The following attestation bundles were made for hyperion_utmosv2-1.3.1-py3-none-any.whl:
Publisher:
python-publish.yml on hyperion-ml/UTMOSv2
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hyperion_utmosv2-1.3.1-py3-none-any.whl -
Subject digest:
f8f306c4108fd8273ee5975ec12e6180ac9e4e45f9b541a6a55d7724fd39b322 - Sigstore transparency entry: 2553570943
- Sigstore integration time:
-
Permalink:
hyperion-ml/UTMOSv2@59b166da5290b83c92fd953ff327accbe43555e1 -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/hyperion-ml
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@59b166da5290b83c92fd953ff327accbe43555e1 -
Trigger Event:
release
-
Statement type: