Downloads · 30 days
1.4K
3% of all-time downloads
BSC-LT/vocos-mel-22khz
vocos-mel-22khz is a machine learning model from BSC-LT. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Vocos is a fast neural vocoder designed to synthesize audio waveforms from acoustic features. Unlike other typical GAN-based vocoders, Vocos does not model audio samples in the time domain. Instead, it generates spect…
Downloads · 30 days
1.4K
3% of all-time downloads
All-time downloads
43.9K
Public
Repo size
1.1 GB
Likes
8
Public
Click a slice to open those files.
.ckpt673 MB · 86%
From the Hugging Face model README
Vocos is a fast neural vocoder designed to synthesize audio waveforms from acoustic features. Unlike other typical GAN-based vocoders, Vocos does not model audio samples in the time domain. Instead, it generates spectral coefficients, facilitating rapid audio reconstruction through inverse Fourier transform.
This version of vocos uses 80-bin mel spectrograms as acoustic features which are widespread in the TTS domain since the introduction of hifi-gan The goal of this model is to provide an alternative to hifi-gan that is faster and compatible with the acoustic output of several TTS models.
We are grateful with the authors for open sourcing the code allowing us to modify and train this version.
The model is aimed to serve as a vocoder to synthesize audio waveforms from mel spectrograms. Is trained to generate speech and if is used in other audio domain is possible that the model won't produce high quality samples.
Use the code below to get started with the model.
To use Vocos only in inference mode, install it using:
pip install git+https://github.com/langtech-bsc/vocos.git@matcha
import torch
from vocos import Vocos
vocos = Vocos.from_pretrained("BSC-LT/vocos-mel-22khz")
mel = torch.randn(1, 80, 256) # B, C, T
audio = vocos.decode(mel)
Matcha-TTS <a target="_blank" href="https://colab.research.google.com/drive/1DvMR8z4XbyuhsSpeLZ83i95Ud0z6vQ2H"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
Fastpitch <a target="_blank" href="https://colab.research.google.com/drive/1SA90s_TMoTLpxbWWBB4CxGKz0hVw4fwL"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>
import torchaudio
y, sr = torchaudio.load(YOUR_AUDIO_FILE)
if y.size(0) > 1: # mix to mono
y = y.mean(dim=0, keepdim=True)
y = torchaudio.functional.resample(y, orig_freq=sr, new_freq=22050)
y_hat = vocos(y)
We also release a onnx version of the model, you can check in colab:
<a target="_blank" href="https://colab.research.google.com/github/langtech-bsc/vocos/blob/matcha/notebooks/vocos_22khz_onnx_inference.ipynb"> <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/> </a>The model was trained on 4 speech datasets
| Dataset | Language | Hours |
|---|---|---|
| LibriTTS-r | en | 585 |
| LJSpeech | en | 24 |
| Festcat | ca | 22 |
| OpenSLR69 | ca | 5 |
The model was trained for 1.8M steps and 183 epochs with a batch size of 16 for stability. We used a Cosine scheduler with a initial learning rate of 5e-4. We also modified the mel spectrogram loss to use 128 bins and fmax of 11025 instead of the same input mel spectrogram.
Evaluation was done using the metrics on the original repo, after 183 epochs we achieve:
If this code contributes to your research, please cite the work:
@article{siuzdak2023vocos,
title={Vocos: Closing the gap between time-domain and Fourier-based neural vocoders for high-quality audio synthesis},
author={Siuzdak, Hubert},
journal={arXiv preprint arXiv:2306.00814},
year={2023}
}
The Language Technologies Unit from Barcelona Supercomputing Center.
For further information, please send an email to [email protected].
Copyright(c) 2024 by Language Technologies Unit, Barcelona Supercomputing Center.
This work has been promoted and financed by the Generalitat de Catalunya through the Aina project.