File size: 1,822 Bytes
a3c6c73
 
6c3b1c5
 
 
 
 
 
 
 
 
 
a3c6c73
6c3b1c5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: mit
library_name: onnxruntime
pipeline_tag: audio-to-audio
tags:
  - music-source-separation
  - htdemucs
  - demucs
  - onnx
  - onnxruntime-web
  - webgpu
  - stem-separation
---

# HTDemucs 6S for ONNX Runtime Web (Audisect build)

Browser-ready ONNX build of **HTDemucs 6S** (Hybrid Transformer Demucs, 6 sources), used by
[Audisect](https://audisect.funkz.app), a free stem splitter that runs entirely in the browser.

| File | Size | SHA-256 |
|---|---|---|
| `htdemucs_6s_web.onnx` | 142,808,361 bytes | `76d177e4cfd7da6aad46e540c5dc929a80f5e839d306a285265f9ec49a28a1ea` |

## Inputs and outputs

- **Input** `mix`: `float32 [1, 2, 343980]`, stereo, 44.1 kHz, 7.8 s, values in [-1, 1].
- **Output**: `float32 [1, 6, 2, 343980]`, stems in order `drums, bass, other, vocals, guitar, piano`.

Process longer audio in overlapping 7.8 s chunks and crossfade the results.

## How this file was made

It is derived from [`StemSplitio/htdemucs-6s-onnx`](https://huggingface.co/StemSplitio/htdemucs-6s-onnx)
(`htdemucs_6s_fp16weights.onnx`) with Audisect's `scripts/prepare_model.py`:

1. float64 constants in the iSTFT converted to float32 (ONNX Runtime Web has no float64 `ConstantOfShape`),
2. graph constant-folded with ONNX Runtime's basic optimisations (24,819 to 1,436 nodes),
3. weights stored as float16 with `Cast` nodes.

Checked against the source model on random input: relative RMS error about 3e-5.

## License and attribution

MIT, same as the upstream weights and export.

- Model: **HTDemucs** by Meta AI Research, [facebookresearch/demucs](https://github.com/facebookresearch/demucs) (MIT).
- Paper: Simon Rouard, Francisco Massa, Alexandre Défossez, *Hybrid Transformers for Music Source Separation*, ICASSP 2023.
- ONNX export: [StemSplit](https://github.com/StemSplit/demucs-onnx) (MIT).