|
--- |
|
license: apache-2.0 |
|
--- |
|
# Music Restoration with UFormer |
|
|
|
These checkpoints accompany the Music Source Restoration paper. (arxiv link coming soon) |
|
|
|
A simple audio restoration toolkit based on UFormer, designed for music source restoration across different instrument groups. Supports long-file inference via overlap-add and multiple checkpoints for specialized restoration (e.g., guitars, vocals, synth). |
|
|
|
## Directory Structure |
|
|
|
```bash |
|
music-restoration/ # Root of the repository |
|
βββ model.py # UFormerConfig & UFormer definitions |
|
βββ inference.py # Inference entry-point (CLI, HF API, Gradio) |
|
βββ requirements.txt # Dependencies: torch, soundfile, gradio, huggingface_hub |
|
βββ .gitattributes # LFS tracking for checkpoints |
|
βββ README.md |
|
βββ checkpoints/ # Pretrained weights |
|
βββ acoustic_guitar.pth |
|
βββ bass.pth |
|
βββ electric_guitar.pth |
|
βββ guitars.pth |
|
βββ keyboards.pth |
|
βββ orchestra.pth |
|
βββ rhythm_section.pth |
|
βββ synth.pth |
|
βββ vocals.pth |
|
``` |
|
|
|
## Installation |
|
|
|
```bash |
|
pip install -r requirements.txt |
|
``` |
|
|
|
## Usage |
|
|
|
### Command-Line Interface |
|
|
|
```bash |
|
python inference.py \ |
|
--input noisy.wav \ |
|
--output restored.wav \ |
|
--checkpoint guitars |
|
``` |
|
|
|
### Hugging Face Inference API |
|
|
|
Send a JSON payload: |
|
|
|
```json |
|
{ |
|
"inputs": <raw WAV bytes>, |
|
"parameters": { "checkpoint": "vocals" } |
|
} |
|
``` |
|
|
|
### Gradio Demo (Spaces) |
|
|
|
```bash |
|
python inference.py --serve |
|
``` |
|
|
|
Open the provided local URL to upload audio and select a checkpoint. |
|
|
|
## Checkpoints |
|
|
|
Available models for different instrument groups: |
|
|
|
* `acoustic_guitar` |
|
* `bass` |
|
* `electric_guitar` |
|
* `guitars` |
|
* `keyboards` |
|
* `orchestra` |
|
* `rhythm_section` |
|
* `synth` |
|
* `vocals` |
|
|
|
## License |
|
|
|
Apache 2.0 License. See [LICENSE](LICENSE) for details. |
|
|