|
Download README.md from voiceclonnx/focalcodec: direct link, hf CLI and curl.
- Browser
- Download file 2.31 kB
-
https://huggingface.co/voiceclonnx/focalcodec/resolve/main/README.md
- Command line
-
hf download hf://voiceclonnx/focalcodec/README.md
-
curl -L -o README.md https://huggingface.co/voiceclonnx/focalcodec/resolve/main/README.md
2.31 kB
| license: apache-2.0 | |
| tags: | |
| - voice-conversion | |
| - onnx | |
| - vconnx | |
| - focalcodec | |
| - speech | |
| library_name: vconnx | |
| # vconnx-focalcodec | |
| ONNX artifacts for the **FocalCodec** voice-conversion engine in | |
| [vconnx](https://github.com/TigreGotico/vconnx) β a pure-ONNX multi-engine | |
| voice-cloning library (no torch at runtime). | |
| ## VC Mechanism | |
| FocalCodec (Della Libera et al., NeurIPS 2025) exposes continuous pre-VQ | |
| features from its WavLM encoder. Voice conversion is a kNN feature-space | |
| swap (cosine distance, k=4) β the same approach as kNN-VC: | |
| 1. **WavLM encoder** (`focalcodec_encoder.onnx`) β 16 kHz audio β | |
| (T, 1024) feature frames at 50 Hz. | |
| 2. **kNN matching** β pure numpy, cosine distance; no ONNX needed. | |
| 3. **Vocos backbone + proj** (`focalcodec_vocoder.onnx`) β matched | |
| (T, 1024) features β (T, n_fft+2) STFT coefficients. | |
| 4. **numpy ISTFT** β pure numpy overlap-add; implemented in the adapter | |
| (parity vs torch β€ 1.3e-5 max abs). | |
| ## Files | |
| | File | Size | Description | | |
| |---|---|---| | |
| | `focalcodec_encoder.onnx` | 594.6 MB | WavLM encoder, fp32, opset 14 | | |
| | `focalcodec_encoder_q8.onnx` | 341.2 MB | WavLM encoder, INT8 quantized | | |
| | `focalcodec_vocoder.onnx` | 64.3 MB | Vocos backbone + proj, fp32, opset 14 | | |
| | `focalcodec_vocoder_q8.onnx` | 16.3 MB | Vocos backbone + proj, INT8 quantized | | |
| | `config.json` | β | Engine manifest | | |
| | `PROVENANCE.md` | β | Export lineage | | |
| ## Parity | |
| | Component | max abs error | mean abs error | | |
| |---|---|---| | |
| | encoder (fp32) | 4.2e-4 | 1.8e-5 | | |
| | vocoder backbone (fp32) | 2.7e-5 | 2.1e-6 | | |
| | numpy ISTFT vs torch | 1.3e-5 | 3.3e-7 | | |
| ## Usage | |
| ```bash | |
| pip install vconnx[focalcodec] | |
| ``` | |
| ```python | |
| from vconnx import VoiceCloner | |
| cloner = VoiceCloner(engine="focalcodec") | |
| out = cloner.clone_voice("source.wav", "reference.wav", "output.wav") | |
| ``` | |
| ## License | |
| Apache-2.0 β upstream weights and code are Apache-2.0 | |
| ([lucadellalib/focalcodec](https://github.com/lucadellalib/focalcodec)). | |
| These ONNX artifacts are derived from `lucadellalib/focalcodec_50hz` | |
| checkpoint at v0.0.2. | |
| ## References | |
| - Paper: https://arxiv.org/abs/2502.04465 | |
| - Upstream: https://github.com/lucadellalib/focalcodec | |
| - Upstream checkpoint: https://huggingface.co/lucadellalib/focalcodec_50hz | |
| - vconnx: https://github.com/TigreGotico/vconnx | |