Update README.md
Browse files
README.md
CHANGED
|
@@ -11,6 +11,25 @@ Demo of audio restorations: [VoiceRestore](https://sparkling-rabanadas-3082be.ne
|
|
| 11 |
|
| 12 |
Credits: This repository is based on the [E2-TTS implementation by Lucidrains](https://github.com/lucidrains/e2-tts-pytorch)
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
## Example
|
| 15 |
### Degraded Input:
|
| 16 |
|
|
@@ -44,48 +63,6 @@ https://github.com/user-attachments/assets/fdbbb988-9bd2-4750-bddd-32bd5153d254
|
|
| 44 |
- **Pretrained Model**: Includes a 301 million parameter transformer model with pre-trained weights. (Model is still in the process of training, there will be further checkpoint updates)
|
| 45 |
|
| 46 |
---
|
| 47 |
-
## Quick Start
|
| 48 |
-
|
| 49 |
-
1. Clone the repository:
|
| 50 |
-
```bash
|
| 51 |
-
git clone --recurse-submodules https://github.com/skirdey/voicerestore.git
|
| 52 |
-
cd VoiceRestore
|
| 53 |
-
```
|
| 54 |
-
|
| 55 |
-
if you did not clone with `--recurse-submodules`, you can run:
|
| 56 |
-
```bash
|
| 57 |
-
git submodule update --init --recursive
|
| 58 |
-
```
|
| 59 |
-
|
| 60 |
-
2. Install dependencies:
|
| 61 |
-
```bash
|
| 62 |
-
pip install -r requirements.txt
|
| 63 |
-
```
|
| 64 |
-
|
| 65 |
-
3. Download the [pre-trained model](https://drive.google.com/drive/folders/1uBJNp4mrPJQY9WEaiTI9u09IsRg1lAPR?usp=sharing) and place it in the `checkpoints` folder.
|
| 66 |
-
|
| 67 |
-
4. Run a test restoration:
|
| 68 |
-
```bash
|
| 69 |
-
python inference_short.py --checkpoint ./checkpoints/voice-restore-20d-16h-optim.pt --input test_input.wav --output test_output.wav --steps 32 --cfg_strength 0.5
|
| 70 |
-
```
|
| 71 |
-
This will process `test_input.wav` and save the result as `test_output.wav`.
|
| 72 |
-
|
| 73 |
-
5. Run a long form restoration, it uses window chunking:
|
| 74 |
-
```bash
|
| 75 |
-
python inference_long.py --checkpoint ./checkpoints/voice-restore-20d-16h-optim.pt --input test_input_long.wav --output test_output_long.wav --steps 32 --cfg_strength 0.5 --window_size_sec 10.0 --overlap 0.25
|
| 76 |
-
```
|
| 77 |
-
This will process `test_input_long.wav` (you need to provide it) and save the result as `test_output_long.wav`.
|
| 78 |
-
|
| 79 |
-
## Usage
|
| 80 |
-
|
| 81 |
-
To restore your own audio files:
|
| 82 |
-
|
| 83 |
-
```python
|
| 84 |
-
from model import OptimizedAudioRestorationModel
|
| 85 |
-
|
| 86 |
-
model = OptimizedAudioRestorationModel()
|
| 87 |
-
restored_audio = model.forward(input_audio, steps=32, cfg_strength=0.5)
|
| 88 |
-
```
|
| 89 |
|
| 90 |
|
| 91 |
|
|
|
|
| 11 |
|
| 12 |
Credits: This repository is based on the [E2-TTS implementation by Lucidrains](https://github.com/lucidrains/e2-tts-pytorch)
|
| 13 |
|
| 14 |
+
## Usage
|
| 15 |
+
``` bash
|
| 16 |
+
!git lfs install
|
| 17 |
+
!git clone https://huggingface.co/jadechoghari/VoiceRestore
|
| 18 |
+
%cd VoiceRestore
|
| 19 |
+
!pip install -r requirements.txt
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
``` python
|
| 23 |
+
from transformers import AutoModel
|
| 24 |
+
# path to the model folder (on colab it's as follows)
|
| 25 |
+
checkpoint_path = "/content/VoiceRestore"
|
| 26 |
+
model = AutoModel.from_pretrained(checkpoint_path, trust_remote_code=True)
|
| 27 |
+
model("test_input.wav", "test_output.wav")
|
| 28 |
+
```
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
|
| 33 |
## Example
|
| 34 |
### Degraded Input:
|
| 35 |
|
|
|
|
| 63 |
- **Pretrained Model**: Includes a 301 million parameter transformer model with pre-trained weights. (Model is still in the process of training, there will be further checkpoint updates)
|
| 64 |
|
| 65 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
|
| 68 |
|