File size: 1,940 Bytes
ae66d47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
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.