Rewrite card: shorter, plain sentences
Browse files
README.md
CHANGED
|
@@ -13,129 +13,130 @@ tags:
|
|
| 13 |
|
| 14 |
# WideCodec β 44.1 kHz decoder
|
| 15 |
|
| 16 |
-
|
|
|
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
|
|
|
|
| 21 |
|
| 22 |
-
##
|
| 23 |
|
| 24 |
-
Everything needed
|
| 25 |
-
`infer_widecodec.py`. No other source code required.
|
| 26 |
|
| 27 |
```bash
|
| 28 |
pip install torch transformers huggingface_hub local-attention einops librosa soundfile
|
| 29 |
-
huggingface-cli login # if this repo is private (or export HF_TOKEN=hf_...)
|
| 30 |
-
|
| 31 |
huggingface-cli download Scicom-intl/WideCodec --local-dir WideCodec
|
| 32 |
cd WideCodec
|
| 33 |
-
python infer_widecodec.py --input my.wav --out-dir out #
|
| 34 |
-
python infer_widecodec.py --input folder/ --out-dir out # a directory
|
| 35 |
```
|
| 36 |
|
| 37 |
-
Or load it directly in Python:
|
| 38 |
-
|
| 39 |
```python
|
| 40 |
-
import sys; sys.path.insert(0, "WideCodec")
|
| 41 |
-
import torch, librosa
|
| 42 |
from neucodec import NeuCodec
|
| 43 |
|
| 44 |
-
model = NeuCodec._from_pretrained(model_id="Scicom-intl/WideCodec", decoder_depth=20)
|
|
|
|
|
|
|
| 45 |
wav16, _ = librosa.load("my.wav", sr=16000, mono=True) # encoder ingests 16 kHz mono
|
| 46 |
x = torch.from_numpy(wav16).float().view(1, 1, -1).cuda()
|
| 47 |
with torch.no_grad():
|
| 48 |
-
codes
|
| 49 |
-
wav44
|
|
|
|
| 50 |
```
|
| 51 |
|
| 52 |
-
|
|
|
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|---|---|
|
| 56 |
-
| `pytorch_model.bin` | decoder weights for **inference** (load with `NeuCodec._from_pretrained(..., decoder_depth=20)`) |
|
| 57 |
-
| `last.ckpt` | full PyTorch-Lightning checkpoint **with optimizer states + LR schedulers** for **resuming training** |
|
| 58 |
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
Offline benchmark on a **heavily multilingual 9,291-clip wideband set** (50 clips Γ 188 clean β₯44.1 kHz datasets, **400+ language/dialect tags**),
|
| 62 |
-
faster-UTMOSv2 + spectral vs ground truth.
|
| 63 |
|
| 64 |

|
| 65 |
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
| codec | native SR | tokens/s | codebooks | ~bitrate | UTMOSv2 | mel-L1 β | HFβ₯11k | rolloff |
|
| 69 |
|---|--:|--:|--:|--:|--:|--:|--:|--:|
|
| 70 |
| ground truth | β | β | β | β | 2.822 | β | 0.00244 | 8263 |
|
| 71 |
-
| nvidia nemo44k | 44.1k | ~86 | RVQ (many) | ~6β9 kbps |
|
| 72 |
-
| **WideCodec (
|
| 73 |
-
| WideCodec (
|
| 74 |
| dac | 44.1k | 86 | 9 | ~8 kbps | 2.672 | **0.341** | 0.00156 | 8185 |
|
| 75 |
| snac44k | 44.1k | multi-scale | 3β4 | ~2.6 kbps | 2.340 | 0.493 | 0.00158 | 8402 |
|
| 76 |
| encodec48k | 48k | 150 | RVQ | 24 kbps | 2.042 | 0.458 | 0.00169 | 8800 |
|
| 77 |
|
| 78 |
-
**
|
| 79 |
-
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
|
| 82 |
-
The
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
(+0.153, paired t=+14.2), and reference-based **PESQ-WB also improves** (+0.017, t=+7.5) β so naturalness and
|
| 91 |
-
fidelity moved together rather than trading off. Full report: evaluation/REPORT_44k_class_codecs.md.
|
| 92 |
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
-
|
| 96 |
|
| 97 |
| stage | data | how to load |
|
| 98 |
|---|---|---|
|
| 99 |
-
| **
|
| 100 |
-
| **
|
| 101 |
|
| 102 |
```python
|
| 103 |
-
# the `neucodec/` package is bundled in this repo (see 'Inference (self-contained)')
|
| 104 |
-
from neucodec import NeuCodec
|
| 105 |
-
|
| 106 |
-
# Stage 1 (first-stage noisy training) β pin the exact revision:
|
| 107 |
model = NeuCodec._from_pretrained(
|
| 108 |
model_id="Scicom-intl/WideCodec",
|
| 109 |
decoder_depth=20,
|
| 110 |
-
revision="d2c612f4319c1c1e0c65a9431a7d6db1b7955ce0",
|
| 111 |
)
|
| 112 |
```
|
| 113 |
|
| 114 |
## Training data
|
| 115 |
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
expressive and anechoic speech. Two groups:
|
| 119 |
|
| 120 |
-
|
| 121 |
|
| 122 |
| dataset | content |
|
| 123 |
|---|---|
|
| 124 |
-
| [`malaysia-ai/malaysian-podcast-youtube`](https://huggingface.co/datasets/malaysia-ai/malaysian-podcast-youtube) | Malay long-form
|
| 125 |
| [`malaysia-ai/singaporean-podcast-youtube`](https://huggingface.co/datasets/malaysia-ai/singaporean-podcast-youtube) | Singaporean English podcasts (~1,255 h) |
|
| 126 |
| [`malaysia-ai/Multilingual-TTS`](https://huggingface.co/datasets/malaysia-ai/Multilingual-TTS) | CommonVoice-sidon multilingual short clips |
|
| 127 |
-
| [`malaysia-ai/malaysian-cartoons-youtube`](https://huggingface.co/datasets/malaysia-ai/malaysian-cartoons-youtube) | 48 kHz cartoon dialogue
|
| 128 |
| [`malaysia-ai/malaysian-movie-youtube`](https://huggingface.co/datasets/malaysia-ai/malaysian-movie-youtube) | 48 kHz Malay movie dialogue |
|
| 129 |
| [`ylacombe/expresso`](https://huggingface.co/datasets/ylacombe/expresso) | 48 kHz expressive read speech |
|
| 130 |
| [`nytopop/expresso-conversational`](https://huggingface.co/datasets/nytopop/expresso-conversational) | 48 kHz improvised dialogue |
|
| 131 |
-
| EARS | 48 kHz anechoic fullband
|
| 132 |
-
|
| 133 |
-
### Scale-up: 336 verified β₯ 44 kHz datasets
|
| 134 |
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
|
| 140 |
<details>
|
| 141 |
<summary>Full list of 336 β₯ 44 kHz source datasets</summary>
|
|
@@ -479,28 +480,3 @@ and SR-verified β₯ 44 kHz. Original sources:
|
|
| 479 |
|
| 480 |
</details>
|
| 481 |
|
| 482 |
-
## Usage
|
| 483 |
-
|
| 484 |
-
See the canonical
|
| 485 |
-
**Load from Hugging Face**
|
| 486 |
-
section in the source repo. **`decoder_depth=20` is required** β the weights are a
|
| 487 |
-
depth-20 decoder, so loading with any other depth mismatches the architecture.
|
| 488 |
-
|
| 489 |
-
```python
|
| 490 |
-
import soundfile as sf
|
| 491 |
-
|
| 492 |
-
# the `neucodec/` package is bundled in this repo (see 'Inference (self-contained)')
|
| 493 |
-
from neucodec import NeuCodec
|
| 494 |
-
|
| 495 |
-
# decoder_depth=20 MUST match this repo; pass token=... (or hf login) for access
|
| 496 |
-
model = NeuCodec._from_pretrained(model_id="Scicom-intl/WideCodec", decoder_depth=20)
|
| 497 |
-
model = model.eval().cuda()
|
| 498 |
-
|
| 499 |
-
# encode (16 kHz path, frozen) -> codes -> decode (44.1 kHz, this finetune)
|
| 500 |
-
codes = model.encode_code("input.wav") # [1, 1, T], identical to base NeuCodec
|
| 501 |
-
recon_44k = model.decode_code(codes).squeeze().cpu().numpy()
|
| 502 |
-
sf.write("recon.wav", recon_44k, model.sample_rate) # 44100
|
| 503 |
-
```
|
| 504 |
-
|
| 505 |
-
The discrete codes are **identical to base `neuphonic/neucodec`** β only the reconstruction
|
| 506 |
-
sample rate and fidelity differ.
|
|
|
|
| 13 |
|
| 14 |
# WideCodec β 44.1 kHz decoder
|
| 15 |
|
| 16 |
+
A 0.8 kbps, 44.1 kHz audio tokenizer. Decoder finetune of
|
| 17 |
+
[`neuphonic/neucodec`](https://huggingface.co/neuphonic/neucodec).
|
| 18 |
|
| 19 |
+
| | |
|
| 20 |
+
|---|---|
|
| 21 |
+
| sample rate | 44,100 Hz |
|
| 22 |
+
| tokens/sec | 50 |
|
| 23 |
+
| codebooks | 1 (FSQ, `levels=[4]Γ8`) |
|
| 24 |
+
| bitrate | 0.8 kbps |
|
| 25 |
+
| hop | 882 |
|
| 26 |
|
| 27 |
+
Codes are **identical to base NeuCodec**. Only the reconstruction sample rate and fidelity
|
| 28 |
+
differ.
|
| 29 |
|
| 30 |
+
## Quickstart
|
| 31 |
|
| 32 |
+
Everything needed is in this repo β the `neucodec/` package and `infer_widecodec.py`.
|
|
|
|
| 33 |
|
| 34 |
```bash
|
| 35 |
pip install torch transformers huggingface_hub local-attention einops librosa soundfile
|
|
|
|
|
|
|
| 36 |
huggingface-cli download Scicom-intl/WideCodec --local-dir WideCodec
|
| 37 |
cd WideCodec
|
| 38 |
+
python infer_widecodec.py --input my.wav --out-dir out # file or directory
|
|
|
|
| 39 |
```
|
| 40 |
|
|
|
|
|
|
|
| 41 |
```python
|
| 42 |
+
import sys; sys.path.insert(0, "WideCodec")
|
| 43 |
+
import torch, librosa, soundfile as sf
|
| 44 |
from neucodec import NeuCodec
|
| 45 |
|
| 46 |
+
model = NeuCodec._from_pretrained(model_id="Scicom-intl/WideCodec", decoder_depth=20)
|
| 47 |
+
model = model.eval().cuda()
|
| 48 |
+
|
| 49 |
wav16, _ = librosa.load("my.wav", sr=16000, mono=True) # encoder ingests 16 kHz mono
|
| 50 |
x = torch.from_numpy(wav16).float().view(1, 1, -1).cuda()
|
| 51 |
with torch.no_grad():
|
| 52 |
+
codes = model.encode_code(x) # 0.8 kbps, 50 tok/s
|
| 53 |
+
wav44 = model.decode_code(codes) # 44.1 kHz
|
| 54 |
+
sf.write("recon.wav", wav44.squeeze().cpu().numpy(), model.sample_rate)
|
| 55 |
```
|
| 56 |
|
| 57 |
+
**`decoder_depth=20` is required.** The weights are a depth-20 decoder; any other value
|
| 58 |
+
mismatches the architecture.
|
| 59 |
|
| 60 |
+
## Benchmark
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
+
9,291 clips β 50 each from 188 clean β₯44.1 kHz datasets, 400+ language/dialect tags.
|
| 63 |
+
faster-UTMOSv2 plus spectral measures against ground truth.
|
|
|
|
|
|
|
| 64 |
|
| 65 |

|
| 66 |
|
| 67 |
+
| codec | native SR | tokens/s | codebooks | bitrate | UTMOSv2 | mel-L1 β | HFβ₯11k | rolloff |
|
|
|
|
|
|
|
| 68 |
|---|--:|--:|--:|--:|--:|--:|--:|--:|
|
| 69 |
| ground truth | β | β | β | β | 2.822 | β | 0.00244 | 8263 |
|
| 70 |
+
| nvidia nemo44k | 44.1k | ~86 | RVQ (many) | ~6β9 kbps | 2.903 | 0.379 | 0.00196 | 8372 |
|
| 71 |
+
| **WideCodec** (2026-08-16) | 44.1k | **50** | **1** | **~0.8 kbps** | **2.919** | 0.571 | 0.00223 | 9011 |
|
| 72 |
+
| WideCodec (2026-07-21) | 44.1k | 50 | 1 | ~0.8 kbps | 2.788 | 0.571 | 0.00223 | 9011 |
|
| 73 |
| dac | 44.1k | 86 | 9 | ~8 kbps | 2.672 | **0.341** | 0.00156 | 8185 |
|
| 74 |
| snac44k | 44.1k | multi-scale | 3β4 | ~2.6 kbps | 2.340 | 0.493 | 0.00158 | 8402 |
|
| 75 |
| encodec48k | 48k | 150 | RVQ | 24 kbps | 2.042 | 0.458 | 0.00169 | 8800 |
|
| 76 |
|
| 77 |
+
UTMOSv2 **2.919** β above ground truth (2.822), level with NVIDIA NeMo-44k (2.903), at about
|
| 78 |
+
a tenth of its bitrate.
|
| 79 |
+
|
| 80 |
+
Bitrate = frame rate Γ Ξ£ logβ(codebook size). Here: 8 Β· logβ4 = 16 bits/frame Γ 50 frames/s =
|
| 81 |
+
**800 bps**. DAC: 9 codebooks Γ 10 bits Γ 86 fps β 8 kbps.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
|
| 85 |
+
The 2026-08-16 release gained **+0.131 UTMOSv2** over the previous one at unchanged content
|
| 86 |
+
accuracy β CV22 macro CER 7.70% for both, inside the Β±0.25 pt run-to-run spread. Same
|
| 87 |
+
architecture, same losses, same 50 tokens/s and single codebook. Only the training corpus
|
| 88 |
+
changed, to clean DNSMOS-gated β₯44.1 kHz audio.
|
| 89 |
|
| 90 |
+
Not a benchmark artifact: on a held-out set of 1,330 clips from 138 sources absent from
|
| 91 |
+
training it scores 2.807 against 2.654 (+0.153, paired t = +14.2), and PESQ-WB improves too
|
| 92 |
+
(+0.017, t = +7.5). Naturalness and fidelity moved together.
|
|
|
|
|
|
|
| 93 |
|
| 94 |
+
Full report: `evaluation/REPORT_44k_class_codecs.md`.
|
| 95 |
+
|
| 96 |
+
## Files and revisions
|
| 97 |
+
|
| 98 |
+
| file | what |
|
| 99 |
+
|---|---|
|
| 100 |
+
| `pytorch_model.bin` | decoder weights for inference |
|
| 101 |
+
| `last.ckpt` | full Lightning checkpoint with optimizer states, for resuming training |
|
| 102 |
|
| 103 |
+
Two training stages. `main` points at the latest.
|
| 104 |
|
| 105 |
| stage | data | how to load |
|
| 106 |
|---|---|---|
|
| 107 |
+
| **1 β noisy mix** (steps 0β1.58M) | 8 base corpora + `scale44k`, ~6,500 h, mostly noisy crowdsourced/podcast | pin revision `d2c612f4319c1c1e0c65a9431a7d6db1b7955ce0` |
|
| 108 |
+
| **2 β clean finetune** (from 1.58M) | TTS-Clean44k + Clean-Podcast + clean-teacher pool + EARS/Expresso | `main` |
|
| 109 |
|
| 110 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
model = NeuCodec._from_pretrained(
|
| 112 |
model_id="Scicom-intl/WideCodec",
|
| 113 |
decoder_depth=20,
|
| 114 |
+
revision="d2c612f4319c1c1e0c65a9431a7d6db1b7955ce0", # stage 1
|
| 115 |
)
|
| 116 |
```
|
| 117 |
|
| 118 |
## Training data
|
| 119 |
|
| 120 |
+
High-sample-rate human speech, no synthetic TTS. The scale-up group is SR-verified β₯ 44 kHz
|
| 121 |
+
(probed before inclusion).
|
|
|
|
| 122 |
|
| 123 |
+
**Base corpora:**
|
| 124 |
|
| 125 |
| dataset | content |
|
| 126 |
|---|---|
|
| 127 |
+
| [`malaysia-ai/malaysian-podcast-youtube`](https://huggingface.co/datasets/malaysia-ai/malaysian-podcast-youtube) | Malay long-form podcasts (~2,234 h) |
|
| 128 |
| [`malaysia-ai/singaporean-podcast-youtube`](https://huggingface.co/datasets/malaysia-ai/singaporean-podcast-youtube) | Singaporean English podcasts (~1,255 h) |
|
| 129 |
| [`malaysia-ai/Multilingual-TTS`](https://huggingface.co/datasets/malaysia-ai/Multilingual-TTS) | CommonVoice-sidon multilingual short clips |
|
| 130 |
+
| [`malaysia-ai/malaysian-cartoons-youtube`](https://huggingface.co/datasets/malaysia-ai/malaysian-cartoons-youtube) | 48 kHz cartoon dialogue |
|
| 131 |
| [`malaysia-ai/malaysian-movie-youtube`](https://huggingface.co/datasets/malaysia-ai/malaysian-movie-youtube) | 48 kHz Malay movie dialogue |
|
| 132 |
| [`ylacombe/expresso`](https://huggingface.co/datasets/ylacombe/expresso) | 48 kHz expressive read speech |
|
| 133 |
| [`nytopop/expresso-conversational`](https://huggingface.co/datasets/nytopop/expresso-conversational) | 48 kHz improvised dialogue |
|
| 134 |
+
| EARS | 48 kHz anechoic fullband |
|
|
|
|
|
|
|
| 135 |
|
| 136 |
+
**Scale-up:** 336 further datasets (162 at 48 kHz, 174 at 44.1 kHz), mirrored as
|
| 137 |
+
`<name>*audio.zip` in
|
| 138 |
+
[`malaysia-ai/Multilingual-TTS`](https://huggingface.co/datasets/malaysia-ai/Multilingual-TTS).
|
| 139 |
+
The decoder is language-agnostic β the codebook is frozen β so this is for acoustic diversity.
|
| 140 |
|
| 141 |
<details>
|
| 142 |
<summary>Full list of 336 β₯ 44 kHz source datasets</summary>
|
|
|
|
| 480 |
|
| 481 |
</details>
|
| 482 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|