facebookresearch / denoiser

Real Time Speech Enhancement in the Waveform Domain (Interspeech 2020)We provide a PyTorch implementation of the paper Real Time Speech Enhancement in the Waveform Domain. In which, we present a causal speech enhancement model working on the raw waveform that runs in real-time on a laptop CPU. The proposed model is based on an encoder-decoder architecture with skip-connections. It is optimized on both time and frequency domains, using multiple loss functions. Empirical evidence shows that it is capable of removing various kinds of background noise including stationary and non-stationary noises, as well as room reverb. Additionally, we suggest a set of data augmentation techniques applied directly on the raw waveform which further improve model performance and its generalization abilities.
Other
1.65k stars 302 forks source link

How do I use the pre-train model? #149

Closed GUUser91 closed 1 year ago

GUUser91 commented 1 year ago

First I download the model

python -m denoiser.enhance --dns64 --noisy_dir="input" --out_dir="output"

Then I get this error message

python -m denoiser.enhance --model_path=/home/user/.cache/torch/hub/checkpoints/master64-8a5dfb4bb92753dd.th --noisy_dir="input" --out_dir="output"

INFO:denoiser.pretrained:Loading model from /home/user/.cache/torch/hub/checkpoints/master64-8a5dfb4bb92753dd.th Traceback (most recent call last): File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.10/runpy.py", line 86, in _run_code exec(code, run_globals) File "/home/user/.local/lib/python3.10/site-packages/denoiser/enhance.py", line 155, in enhance(args, local_out_dir=args.out_dir) File "/home/user/.local/lib/python3.10/site-packages/denoiser/enhance.py", line 113, in enhance model = pretrained.get_model(args).to(args.device) File "/home/user/.local/lib/python3.10/site-packages/denoiser/pretrained.py", line 72, in get_model model = deserialize_model(pkg) File "/home/user/.local/lib/python3.10/site-packages/denoiser/utils.py", line 38, in deserialize_model klass = package['class'] KeyError: 'class'