Audio-to-Audio
TensorRT
moonbox
inworld
voice-isolation
speech-enhancement
denoising
noise-suppression
48khz
full-band
Run this model with HF Jobs
Run moonbox-dev/voice-isolator-TensorRT on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/moonbox-dev/voice-isolator-TensorRT. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/moonbox-dev/voice-isolator-TensorRT on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use moonbox-dev/voice-isolator-TensorRT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- TensorRT
How to use moonbox-dev/voice-isolator-TensorRT with TensorRT:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
File size: 16,132 Bytes
8248ed4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | ---
base_model: inworld/voice-isolator
base_model_relation: quantized
license: apache-2.0
pipeline_tag: audio-to-audio
library_name: tensorrt
tags:
- tensorrt
- moonbox
- inworld
- voice-isolation
- speech-enhancement
- denoising
- noise-suppression
- 48khz
- full-band
---
# Inworld Voice Isolator TensorRT
TensorRT engines of [Inworld Voice Isolator](https://huggingface.co/inworld/voice-isolator), made by Moonbox for NVIDIA RTX GPUs. Each precision is one folder holding the
engine, `trt_runner.py` (a small numpy runner: TensorRT plus Polygraphy, no PyTorch) and a script that does the rest
of the pipeline. What the engine takes and returns is under *How to run*.
**Compatibility.** The engines are built *hardware compatible* (Ampere and newer: RTX 30, 40 and 50 series) and
*version compatible* (any TensorRT 10.x from 10.13 on, through its lean runtime). That costs a little speed against an
engine built for one GPU, but no rebuild is needed. Install the runtime with
`pip install "tensorrt-cu12>=10.13,<11" "tensorrt-lean-cu12>=10.13,<11" polygraphy numpy`.
## Files
The last column is the benchmark (details under *How to run*).
| Precision | File | Size | sha256 | Benchmark |
|---|---|---|---|---|
| fp16 | [`fp16/model.engine`](https://huggingface.co/moonbox-dev/voice-isolator-TensorRT/blob/main/fp16/model.engine) | 375.3 MB | `3ad3e431070d` | fp32 math (as the ONNX fp16-storage build): PESQ 3.259, STOI 0.9553, SI-SDR 19.91 dB (the ONNX build 3.261 / 0.9553 / 19.91); no file below the ONNX build by more than 0.003 dB; RTF 0.087 (ONNX 0.26), 7.7 GB peak |
| fp16 | [`fp16/pipeline.py`](https://huggingface.co/moonbox-dev/voice-isolator-TensorRT/blob/main/fp16/pipeline.py) | 4.3 kB | `108a5130bf62` | fp32 math (as the ONNX fp16-storage build): PESQ 3.259, STOI 0.9553, SI-SDR 19.91 dB (the ONNX build 3.261 / 0.9553 / 19.91); no file below the ONNX build by more than 0.003 dB; RTF 0.087 (ONNX 0.26), 7.7 GB peak |
| fp16 | [`fp16/pipeline_trt.py`](https://huggingface.co/moonbox-dev/voice-isolator-TensorRT/blob/main/fp16/pipeline_trt.py) | 1.6 kB | `f2117455aba5` | fp32 math (as the ONNX fp16-storage build): PESQ 3.259, STOI 0.9553, SI-SDR 19.91 dB (the ONNX build 3.261 / 0.9553 / 19.91); no file below the ONNX build by more than 0.003 dB; RTF 0.087 (ONNX 0.26), 7.7 GB peak |
| fp16 | [`fp16/trt_runner.py`](https://huggingface.co/moonbox-dev/voice-isolator-TensorRT/blob/main/fp16/trt_runner.py) | 4.4 kB | `cbc9abb1f59c` | fp32 math (as the ONNX fp16-storage build): PESQ 3.259, STOI 0.9553, SI-SDR 19.91 dB (the ONNX build 3.261 / 0.9553 / 19.91); no file below the ONNX build by more than 0.003 dB; RTF 0.087 (ONNX 0.26), 7.7 GB peak |
## How to run
Inworld Voice Isolator v1 as one TensorRT engine and `pipeline_trt.py`. This is the offline model: 64M parameters, a
band-split dual-path network with transformers and bidirectional Mamba along time and across bands. It keeps the
voice and removes noise, music and reverb from 48 kHz mono audio.
The pipeline is this model's ONNX `pipeline.py` with its graph run as the engine. The STFT, the iSTFT, and the
original's 8 s windows overlapping by 2 s with linear crossfades stay in numpy.
```python
import sys; sys.path.insert(0, "fp16")
import soundfile as sf
from pipeline_trt import VoiceIsolatorTrt
iso = VoiceIsolatorTrt("fp16")
audio, sr = sf.read("noisy.wav", dtype="float32") # mono, 48 kHz (resample other rates first)
sf.write("voice.wav", iso.isolate(audio), 48000)
```
Or `python fp16/pipeline_trt.py noisy.wav voice.wav`. It needs numpy, TensorRT 10.13 (`tensorrt-cu12` or
`tensorrt-lean-cu12`) and Polygraphy, and soundfile to read files. The engine is version-compatible and built for
Ampere or newer GPUs (RTX 30-series and up).
**The engine.** `model.engine` takes `spec` [1, 1025, T, 2] and returns `change` [1, 1025, T, 2].
- `spec` holds the real and imaginary parts of the STFT: n_fft 2048, hop 480, periodic Hann, centred.
- `change` is the complex correction to that spectrum. The output audio is the input plus the iSTFT of the change.
- T runs from 100 to 801 frames, so each call takes 1 to 8 s. Longer audio goes through the 8 s windows; audio
shorter than 1 s isn't accepted.
Inworld's realtime model is a separate graph, in
[moonbox-dev/voice-isolator-realtime-ONNX](https://huggingface.co/moonbox-dev/voice-isolator-realtime-ONNX).
**Precisions.** `fp16/` is built from the ONNX `fp16/` build, whose weights are stored in fp16 and read as fp32 (fp16
activations overflow in this network). The casts are folded into fp32 weights, so the engine's arithmetic is fp32 like
the ONNX build's, and the engine is 375 MB. The Mamba layers' selective scan, an ONNX Scan in the graph, runs as a
TensorRT loop. There is no int8: TensorRT's int8 needs calibrated activations.
**Benchmark.**
- **Data:** VoiceBank-DEMAND test, 824 files at 48 kHz, on an RTX 3080 Laptop GPU.
- **Score:** PESQ-WB, STOI and SI-SDR against the clean speech, and the per-file SI-SDR difference from the ONNX
`fp16/` build.
- **Pass mark** (set before the first run): no file more than 0.5 dB SI-SDR below the ONNX build's. The ONNX build is
itself 81.8 dB from the original (inworld-voice-isolation's `VoiceIsolator.isolate`, offline, fp32).
| | PESQ | STOI | SI-SDR | worst file vs the ONNX build | real-time factor |
|---|---|---|---|---|---|
| original (PyTorch fp32, CUDA) | 3.259 | 0.9553 | 19.91 dB | - | 0.22 |
| ONNX `fp16/` (CUDA) | 3.261 | 0.9553 | 19.91 dB | - | 0.26 |
| TensorRT `fp16/` | 3.259 | 0.9553 | 19.91 dB | -0.003 dB | 0.087 |
The process peaked at 7.7 GB of system memory on Windows, GPU memory included.
## How these were made
From [Inworld Voice Isolator](https://huggingface.co/inworld/voice-isolator) at revision `9b0285b3fe`: each engine was built with TensorRT's builder from Moonbox's published
ONNX graph of the same model and precision. The network is *strongly typed*: every tensor keeps the precision the
ONNX graph gives it, so an fp16 engine computes what the fp16 ONNX build computes. Built on an RTX 3080 Laptop GPU,
it was benchmarked against the original before upload, and the `sha256` column above is what the files must hash to.
## License
Apache-2.0. These files are a derivative of the original model and carry its license: it is copied in this
repository, and it governs your use of these files. The original model card follows unchanged.
---
# Original model card
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/inworld/voice-isolator/resolve/main/docs/assets/inworld-logo-white.svg">
<img src="https://huggingface.co/inworld/voice-isolator/resolve/main/docs/assets/inworld-logo-black.svg" alt="Inworld" width="220">
</picture>
</p>
<h1 align="center">Voice Isolator</h1>
<p align="center">
Open-license (Apache-2.0) 48 kHz voice isolation for noisy speech recordings and live audio.
</p>
<p align="center">
<a href="https://github.com/inworld-ai/voice-isolator"><img src="https://img.shields.io/badge/GitHub-inworld--ai%2Fvoice--isolator-181717?logo=github" alt="GitHub: inworld-ai/voice-isolator"></a>
</p>
---
## TL;DR
Inworld Voice Isolator v1 ships as two models that share one architecture:
| | `voice-isolator-v1` | `voice-isolator-v1-realtime` |
|---|---|---|
| made for | recorded audio and anything not latency-sensitive, at the best quality | live audio, as a stream in your pipeline or production |
| how it runs | offline: every frame sees its whole 8 s chunk | a causal stream with 20 ms of look-ahead |
| parameters | 64M | 58M |
**Use them for** cleaning recordings before playback or publication, curating speech datasets and voice pipelines where the speaker's identity must survive.
With the realtime model, use them for live calls and streams.
Subtract the isolated voice from the input to extract background noise or a backing-track residual for vocals/music separation.
**They are not** a speaker selector or a restoration model.
Restoration is planned for version 2 (see [Plans](https://github.com/inworld-ai/voice-isolator#plans)).
## Quick start
Using a coding agent? Point it at the [setup section of AGENTS.md](https://github.com/inworld-ai/voice-isolator/blob/main/AGENTS.md#setting-up-the-voice-isolator-for-a-user): it installs the package, checks the machine with `voice-isolate-doctor` and cleans a first file.
```bash
pip install inworld-voice-isolation
# or from a clone: git clone https://github.com/inworld-ai/voice-isolator && cd voice-isolator && pip install -e .
# a noisy example; a clone also has it at demo/examples/sample_14.wav
curl -LO https://raw.githubusercontent.com/inworld-ai/voice-isolator/main/demo/examples/sample_14.wav
# offline isolation (downloads the offline model on first use):
# the voice goes to sample_14_clean.wav and the removed background
# to sample_14_clean_background.wav, beside it
voice-isolate sample_14.wav sample_14_clean.wav
```
Both are float32 WAVs at 48 kHz, with their original levels preserved; together they reconstruct the aligned mono input.
Use `--output-sr 0` to keep the input rate, `--background noise.wav` to choose the background path for one file, or `--no-background` to save only the voice.
```python
from inworld import voice_isolation
# isolate a recording offline
offline = voice_isolation.VoiceIsolator("inworld/voice-isolator")
wav, sample_rate = voice_isolation.load_audio("sample_14.wav")
voice = offline.isolate(wav, sample_rate)
voice_isolation.save_audio("sample_14_clean.wav", voice, sample_rate, subtype="FLOAT")
voice_isolation.save_audio("sample_14_clean_background.wav", wav - voice, sample_rate, subtype="FLOAT") # what was removed
```
### Streaming
The realtime model isolates the voice as the audio arrives, with 20 ms of look-ahead:
```python
import torch
from inworld import voice_isolation
live = voice_isolation.VoiceIsolator("inworld/voice-isolator",
mode="streaming", lookahead_frames=2)
session = live.stream() # takes 48 kHz mono, in pieces of any size
wav, sample_rate = voice_isolation.load_audio("sample_14.wav") # 48 kHz mono, standing in for a live source
voice = []
for start in range(0, len(wav), 960): # 20 ms at a time, as a microphone delivers it
voice.append(session.push(wav[start:start + 960])) # the samples that are final: play or send them
voice.append(session.flush()) # the rest, once the source ends
voice_isolation.save_audio("sample_14_streamed.wav", torch.cat(voice), sample_rate)
```
The streaming CLI writes only the isolated voice, after the whole file has gone through:
```bash
voice-isolate sample_14.wav sample_14_streamed.wav --mode streaming --lookahead 2
```
The weights download on first use, and their checksums are verified.
The mode picks the checkpoint: `voice-isolator-v1` offline, `voice-isolator-v1-realtime` for streaming.
CUDA is used when available, Apple's Metal backend (`mps`) on an Apple-silicon Mac with PyTorch 2.6 or later, and the CPU otherwise; `--device` picks one.
The code, the [interactive demo](https://github.com/inworld-ai/voice-isolator/blob/main/demo/README.md) and the [benchmark](https://github.com/inworld-ai/voice-isolator/blob/main/bench/README.md) are on GitHub: [inworld-ai/voice-isolator](https://github.com/inworld-ai/voice-isolator).
The demo loads both models at startup: **Offline** processes files and samples into voice and background audio; **Online** streams the microphone for up to 60 seconds with updating waveforms and spectrograms, pausing capture before playback.
## Hardware
Tested on NVIDIA Ampere, Hopper and Blackwell GPUs (A100, H100, B200 and B300) and on CPU.
Smaller GPUs are not tested yet (see [Plans](https://github.com/inworld-ai/voice-isolator#plans)).
## The VIBE benchmark
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/inworld/voice-isolator/resolve/main/docs/assets/board-dark.svg">
<img src="https://huggingface.co/inworld/voice-isolator/resolve/main/docs/assets/board-light.svg" alt="Inworld VIBE full-band tier: denoising score per system" width="100%">
</picture>
</p>
Inworld VIBE (Voice Isolation Benchmark and Evals) ranks 48 kHz voice isolators on two boards.
The chart is the denoising board, which ranks every system except those that put more than 10 dB more energy above a band-limited input's band than inside it; those are ranked on restoration.
Inworld scores every system on its internal evaluation set, which is not distributed.
[How the systems are scored and what the scores mean](https://github.com/inworld-ai/voice-isolator/blob/main/bench/README.md).
## Architecture
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://huggingface.co/inworld/voice-isolator/resolve/main/docs/assets/architecture-dark.svg">
<img src="https://huggingface.co/inworld/voice-isolator/resolve/main/docs/assets/architecture-light.svg" alt="The network: STFT, band split, seven dual-path blocks, per-band heads, iSTFT; the two checkpoints" width="100%">
</picture>
</p>
A band-split dual-path network over the STFT (n_fft 2048, hop 480 at 48 kHz, 10 ms frames).
Each frame's spectrum is cut into 46 bands, narrow at low frequency and wide at the top, one token per band and frame, width 512.
Seven blocks refine the tokens, alternating two kinds.
Four blocks run time attention with rotary position and exclusive self attention, followed by attention across bands.
Three blocks run Mamba along time, followed by Mamba across bands (state 16).
Per-band heads produce a bounded complex mask and a bounded per-bin residual, added to the input spectrum.
The offline model has 64.0M parameters.
The realtime model has 58.2M; its blocks are causal and it carries a look-ahead embedding.
Input is one channel at 48 kHz; nothing is separated or synthesized beforehand.
## Two checkpoints
The offline model, `voice-isolator-v1`, is two-sided: every frame sees its whole 8 s chunk, and long inputs render in 8 s chunks overlapping by 2 s.
The realtime model, `voice-isolator-v1-realtime`, is causal, with a trained look-ahead of 0, 20 or 40 ms; its algorithmic latency is 63 ms at 20 ms of look-ahead.
Both keep the foreground voice: when two people speak at once, the louder voice is kept and one a few dB quieter is removed, while voices at similar levels are usually both kept.
In the speech-enhancement literature, version 1 does denoising (noise suppression): it removes what surrounds the voice and restores nothing the recording lost, such as missing bandwidth; restoration comes with version 2.
## Training data
Inworld Voice Isolator v1 was trained on approximately 10,000 hours of unique audio.
Paired examples built from recorded speech: read and conversational speech in many languages, expressive and character voices, whispered speech, singing, and the speaker's own non-verbal sounds such as laughter, breaths and sighs.
The speech was mixed with environmental and household noise, traffic, rain and wind, music and crowd sound, isolated transient events and competing talkers, through measured and simulated room responses and telephony and codec degradations.
Real recordings of the same speech, captured clean and in rooms, complete the set.
The objective: return the voice as it was recorded, remove everything that is not the speaker (noise, music, other voices and the late room tail), keep the speaker's own non-verbal sounds, level and timing, and invent nothing.
Third-party datasets used in training are credited in [NOTICE](NOTICE).
## License
Code and weights are Apache-2.0 ([LICENSE](LICENSE)).
Third-party notices are in [NOTICE](NOTICE).
## How to contribute
Everyone is welcome to use the model however they like and to make it better in any way they see fit!
Development happens on GitHub: see [CONTRIBUTING.md](https://github.com/inworld-ai/voice-isolator/blob/main/CONTRIBUTING.md) for setup, tests and bug reports.
---
<p align="center">Built for people with ❤️ by Inworld.</p>
|