Giter VIP home page Giter VIP logo

phonefortifiedperceptualloss's Introduction

Phone Fortified Perceptual Loss for Speech Enhancement

This is the official implementation of our paper "Improving Perceptual Quality by Phone-Fortified Perceptual Loss using Wasserstein Distance for Speech" Enhancement"

Requirements

  • pytorch 1.6
  • torchcontrib 0.0.2
  • torchaudio 0.6.0
  • pesq 0.0.1
  • colorama 0.4.3
  • fairseq 0.9.0
  • geomloss 0.2.3

Data preparation

Enhancement model parameters and the wav2vec pre-trained model

Please download the model weights from here, and put the weight file into the PFPL-W and PFPL folder, respectively. The wav2vec pre-trained model can be found in the official repo.

Voice Bank--Demand Dataset

The Voice Bank--Demand Dataset is not provided by this repository. Please download the dataset and build your own PyTorch dataloader from here. For each .wav file, you need to first convert it into 16kHz format by any audio converter (e.g., sox).

sox <48K.wav> -r 16000 -c 1 -b 16 <16k.wav>

Usage

Training

To train the model, please run the following script. The full training process apporximately consumes 19GB of GPU vram. Reduce the batch size if needed.

python main.py \
    --exp_dir <root/dir/of/experiment> \
    --exp_name <name_of_the_experiment> \
    --data_dir <root/dir/of/dataset> \
    --num_workers 16 \
    --cuda \
    --log_interval 100 \
    --batch_size 28 \
    --learning_rate 0.0001 \
    --num_epochs 100 \
    --clip_grad_norm_val 0 \
    --grad_accumulate_batches 1 \
    --n_fft 512 \
    --hop_length 128 \
    --model_type wav2vec \
    --log_grad_norm

Testing

To generate the enhanced sound files, please run:

python generate.py <path/to/PFPL_or_PFPL-W> <path/to/output/dir>

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

phonefortifiedperceptualloss's People

Contributors

alexiehta avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.