https://github.com/danielbinschmid/audio-diffusion-training

Training diffusion models for generating audio and music.

https://github.com/danielbinschmid/audio-diffusion-training

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.7%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Training diffusion models for generating audio and music.

Basic Info
  • Host: GitHub
  • Owner: danielbinschmid
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 91.8 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 1 year ago · Last pushed about 1 year ago
Metadata Files
Readme

README.md

audio-diffusion-training

This repository is a repository with minimal dependencies for training diffusion models for audio, based on TorchJaekwon.

This repository has submodules. Pull them explicitely using sh git submodule update --init --recursive

Setup

  1. Create venv
  2. pip install --upgrade pip
  3. Install torch 2.7.0 (with torchaudio)
  4. pip install -r requirements.txt
  5. Install submodules sh $ cd ./code/deps/TorchJaekwon $ pip install -e . $ cd ../werkzeug $ pip install -e .

Diffusers Dependency

If you want to run our pre-trained latent diffusion model, you need to install diffusers. For the LDM, diffusers is required because we took the VAE from there. In this case, run in addition: sh $ pip install -r requirements_diffusers_extra.txt

Inference

  1. Download the model weights from our googledrive
  2. Use the command line tool for inference and the provided pre-trained models. Install it via sh $ cd code $ pip install -e .
  3. Configure the paths in code/configs/dm. Set the paths to the weights and configuration files.
  4. Configure the number of samples to generate and sampler configuration in the relevant infer.yaml script.
  5. Run inference using lookup table below.

|Model|Inference Command|Required Weight Files| |-|-|-| |MedleySolosDB Unconditional|dm medley uncond code/configs/dm/unconditional_medley_v0/infer.yaml|U-Net: melddpm_v0.pth, HifiGAN:hifigan-ckpt(only generator)| |MedleySolosDB Categorical|dm medley cond code/configs/dm/cond_medley_v0/infer.yaml|U-Net: medley_cond.pth, HifiGAN:hifigan-ckpt(only generator)| |MoisesDB Mel|dm moises mel code/configs/dm/moises_guitar_mel/infer.yaml|U-Net: moises_mel.pth, HifiGAN:hifigan-ckpt(only generator)| |MoisesDB LDM|dm moises ldm code/configs/dm/moises_guitar_ldm/infer.yaml|U-Net: moises_ldm.pth, VAE and vocoder: From diffusers|

Training

Datasets

|Datasets|URL|Note| |-|-|-| |MedleySolosDB|Download from zenodo|| |MoisesDB|Download from the homepage of music.ai/research|The script will automatically create a training and test split. The split is documented using a csv file. To re-use the split, make sure to backup this csv file safely.|

Mel-Spectrogram Based Diffusion Model

  1. Compute normalisation scale of the mel-spectrogram by adapting code/experiments/compute_melminmax.py. Alternatively, re-use the scales pre-computed in the provided pre-trained models in folder code/configs/dm
  2. Generate config by running e.g. code/medley_uncond.sh after setting sh # basic flags EXEC_GENERATE_CFG=true EXEC_TRAIN=false EXEC_TEST=false
  3. Set paths in the generated config file. Make sure to set the path to the pre-trained neural vocoder.
  4. Run training by running e.g. code/medley_uncond.sh after setting sh # basic flags EXEC_GENERATE_CFG=false EXEC_TRAIN=true EXEC_TEST=false

Latent Diffusion Model

  1. Make sure that a pre-trained VAE and vocoder is prepared. If you want to train our MelLDM, make sure to have the dependencies in requirementsdiffusersextra.txt installed.
  2. Train as described above.

Owner

  • Name: danielbin
  • Login: danielbinschmid
  • Kind: user

Informatics Master's student at TU Munich.

GitHub Events

Total
  • Release event: 1
  • Watch event: 1
  • Push event: 1
  • Public event: 1
  • Create event: 1
Last Year
  • Release event: 1
  • Watch event: 1
  • Push event: 1
  • Public event: 1
  • Create event: 1

Dependencies

code/setup.py pypi
requirements.txt pypi
  • matplotlib ==3.10.1
  • pydantic ==2.11.4
  • pydub ==0.25.1
  • tqdm ==4.67.1
requirements_diffusers_extra.txt pypi
  • accelerate ==1.6.0
  • diffusers ==0.33.1
  • nnAudio ==0.3.1
  • transformers ==4.47.1