This code repository contains the official PyTorch implementation for the paper
Audio examples and supplementary materials are available on our project page.
- Create a new virtual environment with Python 3.8 (we have not tested other Python versions, but they may work).
- Install the package dependencies via
pip install -r requirements.txt
. - Your logs will be stored as local TensorBoard logs. Run
tensorboard --logdir logs/
to see them.
- We provide pretrained checkpoints for the unconditional score model here Usage:
- For resuming training, you can use the
--resume_from_checkpoint
option oftrain.py
. - For evaluating these checkpoints, use the
--ckpt
option ofenhancement.py
(see section Evaluation below).
Training is done by executing train.py
. A minimal running example with default settings (as in our paper) can be run with
python train.py --format <your_format>--base_dir <your_base_dir> --gpus 0,
where
your_base_dir
should be a path to a folder containing subdirectoriestrain/
andvalid/
(optionallytest/
as well). The subdirectory structure depends onyour_format
:your_format=wsj0
: Each subdirectory must itself have two subdirectoriesclean/
andnoisy/
, with the same filenames present in both.- Add formats on your own, correpsonding to your data structure
To see all available training options, run python train.py --help
.
These include options for the backbone DNN, the SDE parameters, the PytorchLightning Trainer usual parameters such as max_epochs
, limit_train_batches
and so on.
To run the model on a test set, run
and replace test_dir
rir_dir
and ckpt_score
with the appropriate paths.
Check the paper and different options in enhancement.py
for different posterior/predictor/corrector/diffusion parameters.
- In
preprocessing/
, you will find the data generation script used to create all the datasets used in the paper. Minimal example is:
cd preprocessing;
python3 create_data.py
Please check the script for other options
We kindly ask you to cite our papers in your publication when using any of our research or code:
@article{lemercier2023derevdps,
title={Diffusion Posterior Sampling for Informed Single-Channel Dereverberation},
author={Lemercier, Jean-Marie and Welker, Simon and Gerkmann, Timo},
journal={IEEE Workshop on Applications of Signal Processing to Audio and Acoustics (WASPAA)},
year={2023}
}