Views
No views yet
| File | Description | Size |
|---|---|---|
dacvae_encoder.onnx | Audio encoder (48kHz → latent) | ~110 MB |
dacvae_decoder.onnx | Audio decoder (latent → 48kHz) | ~320 MB |
t5_encoder.onnx | Text encoder (T5-base) | ~440 MB |
dit_single_step.onnx | DiT denoiser (single ODE step) | ~2 GB |
vision_encoder.onnx | Vision encoder (CLIP-based) | ~1.2 GB |
peaframe.onnx | PEAFrame span predictor (audio-text similarity) | ~5.8 GB |
tokenizer/ | SentencePiece tokenizer files (T5) | - |
peaframe_tokenizer/ | ModernBERT tokenizer files (PEAFrame) | - |
peaframe_config.json | PEAFrame scaling parameters | - |
clap_audio_encoder.onnx | CLAP audio encoder (HTSAT-tiny) | ~118 MB |
clap_text_encoder.onnx | CLAP text encoder (RoBERTa-base) | ~481 MB |
clap_tokenizer/ | RoBERTa tokenizer files (CLAP) | - |
clap_config.json | CLAP audio preprocessing parameters | - |
1pip install onnxruntime sentencepiece torchaudio torchvision torchcodec soundfile transformers
2# For CUDA support:
3pip install onnxruntime-gpu1python onnx_inference.py \
2 --audio input.wav \
3 --text "a person speaking" \
4 --output separated.wav1python onnx_inference.py \
2 --video input.mp4 \
3 --text "the sound of typing" \
4 --output separated.wav1python onnx_inference.py \
2 --audio input.wav \
3 --text "horn" \
4 --predict-spans \
5 --output separated.wav1# Focus on specific time ranges
2python onnx_inference.py \
3 --audio input.wav \
4 --text "person speaking" \
5 --anchor + 4.5 7.0 \
6 --anchor + 12.0 15.5 \
7 --output separated.wav
8
9# Ignore specific time ranges
10python onnx_inference.py \
11 --audio input.wav \
12 --text "background music" \
13 --anchor - 0.0 3.0 \
14 --output separated.wav1python onnx_inference.py \
2 --audio input.wav \
3 --text "person speaking" \
4 --rerank \
5 --num-candidates 4 \
6 --output separated.wav--rerank - Enable reranking mode--num-candidates N - Number of candidates (default: 4)--rerank-seed SEED - Random seed for reproducibility1# First generate a mask with SAM3 (see generate_sam3_mask.py)
2python onnx_inference.py \
3 --video input.mp4 \
4 --mask object_mask.mp4 \
5 --text "" \
6 --output isolated.wav \
7 --output-video visualization.mp41python onnx_inference.py \
2 --video input.mp4 \
3 --text "woman speaking" \
4 --model-dir ./my_onnx_models \
5 --output separated.wavonnx_export/ directory.python -m onnx_export.export_all --output_dir ./onnx_models1# DiT Transformer (supports FP16 for 50% size reduction)
2python -m onnx_export.export_dit --output-dir ./onnx_models --model-id facebook/sam-audio-small
3python -m onnx_export.export_dit --output-dir ./onnx_models --model-id facebook/sam-audio-large --fp16 --device cuda
4
5# DACVAE (encoder + decoder)
6python -m onnx_export.export_dacvae --output-dir ./onnx_models --model-id facebook/sam-audio-small
7
8# T5 Text Encoder
9python -m onnx_export.export_t5 --output-dir ./onnx_models --model-id facebook/sam-audio-small
10
11# Vision Encoder
12python -m onnx_export.export_vision --model facebook/sam-audio-small --output ./onnx_models
13
14# PEAFrame Span Predictor
15python -m onnx_export.export_peaframe --output-dir ./onnx_models --verify
16
17# CLAP Reranking (audio + text encoders)
18python -m onnx_export.export_clap --output-dir ./onnx_models --verify--fp16 --device cuda during DiT export to reduce size by 50%:1# Export DiT in FP16 (11.7GB → 5.9GB)
2python -m onnx_export.export_dit \
3 --output-dir ./onnx_models_large_fp16 \
4 --model-id facebook/sam-audio-large \
5 --fp16 \
6 --device cuda| Script | Description |
|---|---|
export_all.py | Export all components at once |
export_dit.py | DiT transformer with FP16 support |
export_dacvae.py | DACVAE encoder and decoder |
export_t5.py | T5 text encoder |
export_vision.py | Vision encoder (CLIP-based) |
export_peaframe.py | PEAFrame span predictor + tokenizer |
export_clap.py | CLAP audio + text encoders for reranking |
standalone_config.py | Config classes for standalone export |