Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,83 @@
|
|
1 |
-
---
|
2 |
-
license: apache-2.0
|
3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
---
|
4 |
+
# Music Restoration with UFormer
|
5 |
+
|
6 |
+
These checkpoints accompany the Music Source Restoration paper. (arxiv link coming soon)
|
7 |
+
|
8 |
+
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).
|
9 |
+
|
10 |
+
## Directory Structure
|
11 |
+
|
12 |
+
```bash
|
13 |
+
music-restoration/ # Root of the repository
|
14 |
+
βββ model.py # UFormerConfig & UFormer definitions
|
15 |
+
βββ inference.py # Inference entry-point (CLI, HF API, Gradio)
|
16 |
+
βββ requirements.txt # Dependencies: torch, soundfile, gradio, huggingface_hub
|
17 |
+
βββ .gitattributes # LFS tracking for checkpoints
|
18 |
+
βββ README.md
|
19 |
+
βββ checkpoints/ # Pretrained weights
|
20 |
+
βββ acoustic_guitar.pth
|
21 |
+
βββ bass.pth
|
22 |
+
βββ electric_guitar.pth
|
23 |
+
βββ guitars.pth
|
24 |
+
βββ keyboards.pth
|
25 |
+
βββ orchestra.pth
|
26 |
+
βββ rhythm_section.pth
|
27 |
+
βββ synth.pth
|
28 |
+
βββ vocals.pth
|
29 |
+
```
|
30 |
+
|
31 |
+
## Installation
|
32 |
+
|
33 |
+
```bash
|
34 |
+
pip install -r requirements.txt
|
35 |
+
```
|
36 |
+
|
37 |
+
## Usage
|
38 |
+
|
39 |
+
### Command-Line Interface
|
40 |
+
|
41 |
+
```bash
|
42 |
+
python inference.py \
|
43 |
+
--input noisy.wav \
|
44 |
+
--output restored.wav \
|
45 |
+
--checkpoint guitars
|
46 |
+
```
|
47 |
+
|
48 |
+
### Hugging Face Inference API
|
49 |
+
|
50 |
+
Send a JSON payload:
|
51 |
+
|
52 |
+
```json
|
53 |
+
{
|
54 |
+
"inputs": <raw WAV bytes>,
|
55 |
+
"parameters": { "checkpoint": "vocals" }
|
56 |
+
}
|
57 |
+
```
|
58 |
+
|
59 |
+
### Gradio Demo (Spaces)
|
60 |
+
|
61 |
+
```bash
|
62 |
+
python inference.py --serve
|
63 |
+
```
|
64 |
+
|
65 |
+
Open the provided local URL to upload audio and select a checkpoint.
|
66 |
+
|
67 |
+
## Checkpoints
|
68 |
+
|
69 |
+
Available models for different instrument groups:
|
70 |
+
|
71 |
+
* `acoustic_guitar`
|
72 |
+
* `bass`
|
73 |
+
* `electric_guitar`
|
74 |
+
* `guitars`
|
75 |
+
* `keyboards`
|
76 |
+
* `orchestra`
|
77 |
+
* `rhythm_section`
|
78 |
+
* `synth`
|
79 |
+
* `vocals`
|
80 |
+
|
81 |
+
## License
|
82 |
+
|
83 |
+
Apache 2.0 License. See [LICENSE](LICENSE) for details.
|