Audio Restoration Studio

August 26, 2025 · View on GitHub

Audio Restoration Studio — Home

Figure: Home screen of the Audio Restoration Studio app.

Short guide on how to set up a local virtual environment, install dependencies, launch the Gradio app (app.py), and (optionally) train the UNet denoiser (unet.py) with CUDA.

1. Clone / Enter Project

Make sure you are inside the project root that contains app.py and unet.py. The notebook main6.ipynb instead was one of the many used for experimentation and earlier development.

2. Create & Activate Virtual Environment (Windows cmd)

python -m venv .venv
call .venv\Scripts\activate
python -m pip install --upgrade pip

(For PowerShell replace the activate line with: .venv\Scripts\Activate.ps1)

3. Choose a Requirements File

You have multiple requirement sets (pick ONE):

  • Windows CPU torch build: requirements.windows-cpu.txt
  • Windows CUDA 12.1 torch build: requirements.windows-cu121.txt

Install one, e.g. for CUDA 12.1:

pip install -r requirements.windows-cu121.txt

Or for Windows CPU:

pip install -r requirements.windows-cpu.txt

unet.py contains a full training script. To strongly encourage CUDA:

  • Ensure you installed the CUDA requirements file (e.g. requirements.windows-cu121.txt).
  • Verify PyTorch detects the GPU:
python -c "import torch; print(torch.cuda.is_available(), torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'NO GPU')"

If it prints True and your GPU name, you are set.

4.1 Basic Training Command

python unet.py --train --train_dir data --epochs 30 --batch_size 8

This will:

  • Auto-download small clean/noise datasets (GTZAN + ESC-50) via Hugging Face
  • Perform on-the-fly degradations
  • Save checkpoints to checkpoints/ (best model: best.pt)

5. Launch the Gradio App

python app.py

Then open the displayed local URL (default http://127.0.0.1:7860/). The app flow:

  1. Load MusicGen (downloads weights on first run)
  2. Generate audio
  3. Degrade (pink noise forced + optional distortions)
  4. Restore with Demucs + S-NMF
  5. Restore with UNet (load checkpoint from checkpoints/)
  6. Compare metrics & plots
  7. Reset

6. Clean Environment / Reset

To start fresh:

deactivate
rmdir /s /q .venv
python -m venv .venv
call .venv\Scripts\activate
pip install -r requirements.txt

Preview

Audio Restoration Studio — Degrade Audio Restoration Studio — Compare

9. License / Credits

Demucs & MusicGen are Meta AI research models (follow their licenses). This project integrates S-NMF, Demucs separation, and a UNet STFT mask model for educational / research use. Such as in our project.