Views
No views yet
git clone git@github.com:tiantiaf0627/vox-profile-release.git1conda create -n vox_profile python=3.8
2cd vox-profile-release
3pip install -e .1# Load libraries
2import torch
3import torch.nn.functional as F
4from src.model.voice_quality.wavlm_voice_quality import WavLMWrapper
5# Find device
6device = torch.device("cuda") if torch.cuda.is_available() else "cpu"
7# Load model from Huggingface
8model = WavLMWrapper.from_pretrained("tiantiaf/wavlm-large-voice-quality").to(device)
9model.eval()1# Label List
2voice_quality_label_list = [
3 'shrill', 'nasal', 'deep', # Pitch
4 'silky', 'husky', 'raspy', 'guttural', 'vocal-fry', # Texture
5 'booming', 'authoritative', 'loud', 'hushed', 'soft', # Volume
6 'crisp', 'slurred', 'lisp', 'stammering', # Clarity
7 'singsong', 'pitchy', 'flowing', 'monotone', 'staccato', 'punctuated', 'enunciated', 'hesitant', # Rhythm
8]
9
10# Load data, here just zeros as the example
11# Our training data filters output audio shorter than 3 seconds (unreliable predictions) and longer than 15 seconds (computation limitation)
12# So you need to prepare your audio to a maximum of 15 seconds, 16kHz, and mono channel
13max_audio_length = 15 * 16000
14data = torch.zeros([1, 16000]).float().to(device)[:, :max_audio_length]
15logits = model(
16 data, return_feature=False
17)
18
19# Probability and output
20voice_quality_prob = nn.Sigmoid()(torch.tensor(logits))
21
22# In practice, a larger threshold would remove some noise, but it is best to aggregate predictions per speaker
23voice_label = list()
24threshold = 0.7
25predictions = (voice_quality_prob > threshold).int().detach().cpu().numpy()[0].tolist()
26for label_idx in range(len(predictions)):
27 if predictions[label_idx] == 1: voice_label.append(voice_quality_label_list[label_idx])
28# print the voice quality labels
29print(voice_label)@article{feng2025vox,
title={Vox-Profile: A Speech Foundation Model Benchmark for Characterizing Diverse Speaker and Speech Traits},
author={Feng, Tiantian and Lee, Jihwan and Xu, Anfeng and Lee, Yoonjeong and Lertpetchpun, Thanathai and Shi, Xuan and Wang, Helin and Thebaud, Thomas and Moro-Velazquez, Laureano and Byrd, Dani and others},
journal={arXiv preprint arXiv:2505.14648},
year={2025}
}