| --- |
| license: cc-by-nc-4.0 |
| tags: |
| - audio-to-audio |
| - demucs |
| - libtorch |
| - coreml |
| - metal |
| - ios |
| - macos |
| pipeline_tag: audio-to-audio |
| --- |
| |
| # HTDemucs (LibTorch / CoreML Ready) |
|
|
| This repository contains **TorchScript (`.pt`)** exports of the [Hybrid Transformer Demucs (htdemucs)](https://github.com/facebookresearch/demucs) model by Meta Research. |
|
|
| These models are optimized for **C++ Inference** (using LibTorch) on Apple Silicon (Metal/MPS) and CPU. |
|
|
| ## ⚠️ License & Attribution |
|
|
| * **Original Model Code:** MIT License (Copyright Meta Platforms, Inc.) |
| * **Pre-Trained Weights:** [CC-BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/) (Research constraints derived from training data). |
|
|
| **Attribution:** |
| > Original work by **Meta Research**. Based on the paper "Hybrid Transformers for Music Source Separation" by Alexandre Défossez et al. |
| > Source Repository: [facebookresearch/demucs](https://github.com/facebookresearch/demucs) |
|
|
| **Disclaimer:** |
| > This is a **format conversion only**. No fine-tuning was performed. The weights are numerically identical to the original release, but packaged for C++ execution without Python dependencies. |
|
|
| ## Model Variants |
|
|
| | Filename | Description | Chunk Size | Target Device | |
| | :--- | :--- | :--- | :--- | |
| | `htdemucs_ft.pt` | **Fast Trace** (Recommended) | 8.0s | Metal (MPS) / GPU | |
| | `htdemucs_6s.pt` | **6-Stem** (Guitar/Piano) | 8.0s | Metal (MPS) / GPU | |
| | `htdemucs_cpu.pt` | CPU Fallback | 8.0s | CPU | |
|
|
| ## Usage (C++) |
|
|
| These models are designed to be loaded directly in C++ using `torch::jit::load()`: |
|
|
| ```cpp |
| #include <torch/script.h> |
| |
| auto module = torch::jit::load("htdemucs_ft.pt"); |
| module.to(torch::kMPS); // Or kCPU |
| module.eval(); |
| |
| // Input: [1, 2, Samples] |
| auto output = module.forward({input_tensor}).toTensor(); |
| ``` |
|
|
| ## Integrity |
|
|
| SHA256 checksums are provided in `SHA256SUMS.txt` to verify file integrity. |
|
|