/ Модель

Характеристики

Размер весов
47,2 МБ
Лицензия
Своя лицензия
Библиотека
onnx
Опубликована
28 июл 2026

yt-precount-scnet-tran-onnx

Обработка аудиоАудио → аудио

ONNX-экспорт SCNet Tran для разделения музыки на вокал, ударные, бас и остальные инструменты в браузере.

0скачиваний за 30 дней0лайковвеса обновлены28 июл 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Это экспорт ядра SCNet Tran в формат ONNX, подготовленный автором репозитория для разделения музыки в браузерном расширении. Сеть SCNet заменяет bi-LSTM блоками Transformer и выделяет четыре стема: ударные, бас, прочие инструменты и вокал. Граф принимает спектрограмму и возвращает спектрограммы разделённых стемов; вычисление STFT и обратного STFT выполняет приложение. Экспорт рассчитан на ONNX Runtime Web и обработку аудио небольшими фрагментами.

Модель использует ONNX opset 17 и float32; входной фрагмент соответствует примерно 2,75 секунды аудио. В README приведены измерения производительности в Chrome на Apple Silicon и сравнение с исходной моделью PyTorch. Это конверсия модели в другой формат с изменениями для совместимости исполнения: преобразования FFT внутри сети заменены матричными умножениями, а STFT/iSTFT вынесены за пределы графа. Репозиторий не заявляет новых прав на веса; метаданные указывают лицензию other, а README отсылает к сведениям о происхождении и лицензии, не приведённым в доступном тексте.

Сценарии применения

  • выделение вокала из музыкальной композиции
  • разделение песни на вокал, ударные, бас и остальные инструменты
  • создание инструментальных и вокальных дорожек для ремикса
  • подготовка отдельных музыкальных стемов для редактирования

Ограничения

Граф обрабатывает спектрограммы, поэтому вызывающее приложение должно самостоятельно выполнять STFT/iSTFT с точно согласованными параметрами и управлять фрагментами аудио. Конверсия fp16 даёт NaN, а производительность зависит от браузера и аппаратного backend.

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

SCNet Tran — ONNX core for in-browser 4-stem separation

ONNX export of the core network of SCNet Tran (SCNet with the separation network's bi-LSTM replaced by transformer layers), prepared for real-time-ish music source separation inside a web browser via onnxruntime-web.

Stems: drums, bass, other, vocals.

This repository exists to host the weight file for a browser extension. It claims no new rights over the weights — see Provenance and license.

Why "core"?

Two things had to change before this model could run under ONNX Runtime Web:

  1. STFT / iSTFT are not in the graph. torch.stft / torch.istft have no stable ONNX equivalent — ONNX DFT cannot set inverse=True and onesided=True at the same time. So the exported graph takes a spectrogram and returns a spectrogram; the consumer performs STFT/iSTFT itself.

  2. The internal FFT was replaced by matrix multiplication. FeatureConversion, in the middle of the separation network, calls torch.fft.rfft / irfft. That is part of the model, not I/O, so it cannot be moved out. It was replaced with multiplication by precomputed DFT basis matrices:

    rfft(norm="ortho"):  real = x @ C,   C[t,k] =  cos(2πkt/N)/√N
                         imag = x @ S,   S[t,k] = -sin(2πkt/N)/√N
    
    irfft(norm="ortho"): x = real @ Ci + imag @ Si
                         Ci[k,t] =  w_k·cos(2πkt/N)/√N
                         Si[k,t] = -w_k·sin(2πkt/N)/√N,   w_0 = w_{N/2} = 1, otherwise 2
    

    Substitution error against the original PyTorch model: max abs 1.04e-06.

Files

FileSizeNotes
scnet-tran-core-2.75s-v1.onnx47,200,340 Bopset 17, fp32, fixed 2.75 s chunk

SHA-256: e2c6e2807e1deb937150c2c2d21db57b597388a67460706242e6f23a2d8f9c56

Interface

input   spec  (1, 4, 2049, 120)  float32   — view_as_real(stft) permuted/reshaped
output  out   (8, 2049, 120, 2)  float32   — pre-view_as_complex; 4 stems × 2 channels

Stem order along the output's first axis: ['drums', 'bass', 'other', 'vocals'], each followed by its two channels.

STFT convention (must match exactly)

Taken from the original scnet_tran.yaml plus torch.stft defaults. Getting any of these wrong still produces audio — it just produces wrong audio, so verify against reference tensors rather than by ear.

n_fft4096 (F = 2049)
hop_length1024
win_length4096
windownone (rectangular) — the config has no window key, so torch.stft defaults to None, i.e. all ones. Not Hann.
centertrue, with reflect padding of n_fft/2 = 2048
normalizedtrue → multiply by 1/√n_fft

iSTFT is the exact inverse in torch.istft's order: undo normalization (×√n_fft) → irfft per frame → overlap-add → divide by the accumulated window-square envelope (with a rectangular window this is 4 in the interior and 2–3 at the edges — dividing by a constant 4 corrupts the boundaries) → strip the 2048-sample center padding.

Chunking

chunk   = 121275 samples (2.75 s @ 44100 Hz)
overlap = 2  →  step = 60637
fade    = 12127  (chunk // 10, linear in/out for overlap-add)

Per chunk, pad to a multiple of hop_length such that the frame count is odd (121275 → 121856, T = 120), run the model, then drop the 581 padded samples. Reflect-pad the whole input by chunk - step at both ends and crop afterwards. First chunk skips the fade-in; last chunk skips the fade-out.

Why 2.75 s and not the original 11 s: the 11 s chunk runs out of memory under onnxruntime-web's WASM backend, and even on WebGPU the small chunk was faster in our measurements.

Measured performance

Chrome, Apple Silicon, onnxruntime-web, 2.75 s chunk:

BackendPer chunkRealtime factor
WebGPU230 ms11.94×
WASM, 8 threads1084 ms2.54×

A 5-minute song at 2× overlap (221 chunks) takes roughly 50 s on WebGPU.

Agreement with the original PyTorch model: correlation 1.000000, max abs difference 6.43e-04.

Note that ONNX Runtime Web's WebGPU backend has no LSTM kernel, which is why the transformer variant (SCNet Tran) is used here rather than plain SCNet — the LSTM variant silently falls back to CPU.

Conversion notes

  • Exported with torch.onnx.export, opset_version=17, dynamo=False.
  • FeatureConversion modules are swapped for matmul equivalents after observing the actual sequence length each one receives via forward pre-hooks — the layers see different T because of differing downsampling, so guessing the lengths does not work.
  • fp16 conversion was attempted and abandoned: intermediate activations exceed fp16 range and the converted graph produces NaNs.

Provenance and license

This file is a format conversion. The rights below belong to their respective holders, and nothing here grants rights that the upstream sources do not already grant.

LayerSourceTerms
Architecture / reference codestarrytong/SCNetMIT
Training code and this variantZFTurbo/Music-Source-Separation-TrainingMIT
Trained weightsZFTurbo release checkpoint scnet_tran.ckptdistributed from the MIT-licensed repository above
Training dataMUSDB18-HQ"provided for educational purposes only and the material contained in them should not be used for any commercial purpose without the express permission of the copyright holders"
This ONNX conversion—conversion procedure released under MIT; no claim over the weights

Because of the MUSDB18-HQ terms, treat this model as non-commercial. The extension it was prepared for is distributed free of charge with no advertising and no revenue.

If you are the rights holder of any layer above and want the hosting or the wording changed, please open a discussion on this repository.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · onnx

Нельзя запустить

Обработка «аудио → аудио» пока не поддерживается.

Ревизия весов
40cb30a

0 моделей