Zum Inhalt springen
ModelAufgelistetExtern
Browse files

Htdemucs Ft Other Onnx

Melodic / instrumental specialist from HT-Demucs FT — everything that isn't vocals, drums, or bass. ONNX runtime, no PyTorch needed.

ArtOtherVersionHtdemucs ft other fp16weightsCBewertung

Modellquelle

Art
Other
Dateigröße
158–302 MB
Version
vHtdemucs ft other fp16weights
Aktualisiert
25. Okt. 2026
Quelle
Hugging Face

Quellenbeschreibung

HT-Demucs FT — Instrumental / Other Specialist, ONNX

Melodic / instrumental specialist from HT-Demucs FT — everything that isn't vocals, drums, or bass. ONNX runtime, no PyTorch needed.

This repo packages sub-model 2 of the htdemucs_ft 4-bag ensemble as a single 316 MB .onnx file plus a ~150-line numpy reference inference script. Verified to be numerically equivalent to the original PyTorch model.

Want all 4 stems in one drop-in package? Use the full bag repo: StemSplitio/htdemucs-ft-onnx.


TL;DR

pip install onnxruntime numpy soundfile
python infer.py your-song.mp3 ./out/
# writes ./out/other.wav at 44.1 kHz stereo

That's it. No PyTorch, no CUDA setup, no GPU server.


Quality

Metric (MUSDB18-HQ test, 50 songs)ValueSource
Median other SDR6.34 dBStemSplitio/stem-separation-benchmark-2026
Rank among open-source separators on other2nd (mdx_extra_q leads at 7.67)same
ONNX vs PyTorch max abs diff< 1e-3verified during export (see Day 1 spike report)

Performance

RuntimeHardwarePer 7.8-s segmentPer 3-min song
onnxruntime CPU EPApple M4 Pro~1.6 s~22 s
PyTorch CPUApple M4 Pro~2.1 s~29 s
onnxruntime CUDA EPNVIDIA L4~0.4 s~5 s (extrapolated)
onnxruntime DirectML EPRTX 4090~0.2 s~2 s (extrapolated)

Real-time factor on M4 Pro CPU: 0.20. Roughly 1.31× faster than PyTorch CPU on the same hardware.


Tooling — demucs-onnx Python package

This model can also be run (and re-exported) via the open-source demucs-onnx Python package on PyPI. It auto-downloads from this repo on first use.

pip install demucs-onnx

# Single specialist (this repo)
demucs-onnx separate song.mp3 stems/ --stem other

# Or via the Python API
python -c "from demucs_onnx import separate_stem; \
  audio = separate_stem('song.mp3', 'other')"

The same package is also the canonical tool for exporting htdemucs to ONNX yourself — it bundles all four blocker fixes (complex STFT, fractions.Fraction, random.randrange, aten::_native_multi_head_attention) so vanilla torch.onnx.export works on your own checkpoints.

pip install "demucs-onnx[export]"
demucs-onnx export htdemucs_ft other.onnx --stem other

Common use cases

  • Karaoke / instrumental tracks — extract the music-minus-vocals layer (pair with the vocals ONNX for clean round-tripping)
  • Sample-flipping — isolate guitar/keys/synth lines for chopping and remixing
  • Cover-song production — strip vocals and rebalance the instrumental bed
  • Music-bed for video — remove vocals from licensed tracks for under-spoken-word use (check sync rights first)

Quick start

Python — minimal

import infer
other = infer.separate_other("your-song.mp3")
# other: numpy array (2, samples) at 44.1 kHz

Python — full control

import soundfile as sf
import infer

# Optional execution providers — CPU is the default and most portable.
# Swap to "coreml" on macOS, "cuda" on NVIDIA, "dml" on Windows DX12.
audio, sr = sf.read("your-song.mp3", dtype="float32", always_2d=True)
stems = infer.separate(audio.T, sr, providers=["CPUExecutionProvider"])
sf.write("other.wav", stems[infer.SOURCES.index("other")].T, sr)

CLI

python infer.py your-song.mp3 ./out/
python infer.py your-song.mp3 ./out/ --providers cuda    # NVIDIA
python infer.py your-song.mp3 ./out/ --providers coreml  # macOS
python infer.py your-song.mp3 ./out/ --providers dml     # Windows

Mobile (iOS / Swift)

import onnxruntime_objc

let env = try ORTEnv(loggingLevel: .warning)
let opts = try ORTSessionOptions()
try opts.appendCoreMLExecutionProvider(with: ORTCoreMLExecutionProviderOptions())
let session = try ORTSession(env: env,
                              modelPath: Bundle.main.path(forResource: "htdemucs_ft_other", ofType: "onnx")!,
                              sessionOptions: opts)
// audio: 1 × 2 × 343980 Float32 buffer, then session.run(...).

Mobile (Android / Kotlin)

import ai.onnxruntime.OrtEnvironment
import ai.onnxruntime.OrtSession

val env = OrtEnvironment.getEnvironment()
val opts = OrtSession.SessionOptions().apply { addNnapi() }
val session = env.createSession(modelPath, opts)

Web (onnxruntime-web)

import * as ort from "onnxruntime-web";
const session = await ort.InferenceSession.create("htdemucs_ft_other.onnx", {
  executionProviders: ["wasm"],
  graphOptimizationLevel: "all",
});
const tensor = new ort.Tensor("float32", audioBuffer, [1, 2, 343980]);
const out = await session.run({ mix: tensor });
// out.stems.data is a Float32Array (1, 4, 2, 343980); use row 2 for other.

Input / output spec

TensorNameShapeDtypeNotes
Inputmix(1, 2, 343980)float32Stereo audio, 44.1 kHz, 7.8 s segment. Values in [-1, 1].
Outputstems(1, 4, 2, 343980)float32[drums, bass, other, vocals] order. Use only row 2 (other) — the other 3 rows are weakly-predicted by-products of the other specialist.

For longer audio, chunk with overlap-add — see infer.py::separate for a working ~60-line implementation.


Related repos

Sibling stem-specialist ONNX repos from the same export:

RepoStemUse when
htdemucs-ft-drums-onnxdrumsDrum extraction, beat transcription
htdemucs-ft-bass-onnxbassBassline transcription, mix rebalancing
htdemucs-ft-other-onnxotherKaraoke instrumentals, sample-flipping
htdemucs-ft-vocals-onnxvocals#1 open-source vocal SDR — karaoke, acapella, vocal removal
htdemucs-ft-onnxall 4Full 4-stem separation in one repo

PyTorch versions for HF Inference Endpoints: htdemucs-ft-pytorch, htdemucs-ft-other-pytorch.

Full benchmark across every popular open-source separator: StemSplitio/stem-separation-benchmark-2026.


Skip the infrastructure — use the StemSplit API

Don't want to ship a 316 MB model in your app, manage a GPU pool, or write overlap-add chunking? Use the StemSplit API instead — same model under the hood, hosted for you, with credits and a dashboard.

Or use the no-code tools that ship the same model family:


Files in this repo

FileSizePurpose
htdemucs_ft_other.onnx316 MBThe exported model. Opset 17. Passes onnx.checker.
infer.py~6 KBPure numpy + onnxruntime reference. No torch.
requirements.txt<1 KBonnxruntime, numpy, soundfile.
README.mdthis file

License & attribution

This repo is MIT-licensed, matching the original HT-Demucs.

@inproceedings{rouard2023hybrid,
  title     = {Hybrid Transformers for Music Source Separation},
  author    = {Rouard, Simon and Massa, Francisco and D{\'e}fossez, Alexandre},
  booktitle = {ICASSP},
  year      = {2023}
}
  • Original PyTorch model: facebookresearch/demucs
  • ONNX export, parity verification, and packaging by StemSplit
  • Search keywords: instrumental extractor onnx, karaoke maker, music minus vocals, htdemucs other onnx

Quellen

1 Quelle
Hugging FacePrimärVersion db6d606b4a6ee0b34f3fb09a6be4d23b07811318
huggingface.co/StemSplitio/htdemucs-ft-other-onnx/tree/db6d606b4a6ee0b34f3fb09a6be4d23b07811318

Verifiziert 25. Okt.

Download files

Modellartefakte

2 Artefakte

htdemucs_ft_other_fp16weights.onnx

onnx · 158 MB · SHA-256 b739171a7057…bd71 · Hugging Face

Download file

htdemucs_ft_other.onnx

onnx · 302 MB · SHA-256 90e11806c1bb…daad · Hugging Face

Download file

Quellenauszüge

2 Auszüge

--- language: en license: mit library_name: onnxruntime pipeline_tag: audio-to-audio tags: - onnx - onnxruntime - stem-separation - source-separation - demucs - htdemucs - music - audio-to-audio - mobile - ios - android - coreml - directml - production-ready - instrumental-extraction - karaoke - music-minus-one datasets: - StemSplitio/stem-separation-benchmark-2026 inference: false --- # HT-Demucs FT — Instrumental / Other Specialist, ONNX Melodic / instrumental specialist from HT-Demucs FT — everything that isn't vocals, drums, or bass. ONNX runtime, no PyTorch needed. This repo packages sub-model 2 of the [`htdemucs_ft`](https://github.com/facebookresearch/demucs) 4-bag ensemble as a single 316 MB `.onnx` file plus a ~150-line numpy reference inference script. Verified to be **numerically equivalent** to the original PyTorch model. > Want all 4 stems in one drop-in package? Use the full bag repo: > [`StemSplitio/htdemucs-ft-onnx`](https://huggingface.co/StemSplitio/htdemucs-ft-onnx). --- ## TL;DR ```bash pip install onnxruntime numpy soundfile python infer.py your-song.mp3 ./out/ # writes ./out/other.wav at 44.1 kHz stereo ``` That's it. No PyTorch, no CUDA setup, no GPU server. --- ## Quality | Metric (MUSDB18-HQ test, 50 songs) | Value | Source | |---|---|---| | Median other SDR | **6.34 dB** | [StemSplitio/stem-separation-benchmark-2026](https://huggingface.co/datasets/StemSplitio/stem-separation-benchmark-2026) | | Rank among open-source separators on other | 2nd (mdx_extra_q leads at 7.67) | same | | ONNX vs PyTorch max abs diff | **< 1e-3** | verified during export (see [Day 1 spike report](https://huggingface.co/StemSplitio/htdemucs-ft-drums-onnx#how-it-was-built)) | --- ## Performance | Runtime | Hardware | Per 7.8-s segment | Per 3-min song | |---|---|---:|---:| | **onnxruntime CPU EP** | Apple M4 Pro | **~1.6 s** | **~22 s** | | PyTorch CPU | Apple M4 Pro | ~2.1 s | ~29 s | | onnxruntime CUDA EP | NVIDIA L4 | ~0.4 s | ~5 s *(extrapolated)* | | onnxruntime DirectML EP | RTX 4090 | ~0.2 s | ~2 s *(extrapolated)* | **Real-time factor on M4 Pro CPU: 0.20.** Roughly 1.31× faster than PyTorch CPU on the same hardware. --- ## Tooling — `demucs-onnx` Python package This model can also be run (and re-exported) via the open-source [`demucs-onnx`](https://github.com/StemSplit/demucs-onnx) Python package on PyPI. It aut...

Source context: 0 downloads · 0 likes · Pipeline audio-to-audio · Library onnxruntime · Repo StemSplitio/htdemucs-ft-other-onnx