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

Suggestion for flush method of DemucsStreamer #137

Closed hoyaaaa closed 1 year ago

hoyaaaa commented 1 year ago

In enhance.py, DemucsStreamer object is initialized for each wav noisy. https://github.com/facebookresearch/denoiser/blob/8f006f4c492b24bcbf8b3df33b9d38520c908c55/denoiser/enhance.py#L57-L64

In live.py, DemucsStreamer object is initialized only once before live streaming in live.py and used it until end. https://github.com/facebookresearch/denoiser/blob/8f006f4c492b24bcbf8b3df33b9d38520c908c55/denoiser/live.py#L86-L88

So, in two cases above, It may not need my suggestion, but I will use only one DemucsStreamer instance without re-initialization. https://github.com/facebookresearch/denoiser/blob/8f006f4c492b24bcbf8b3df33b9d38520c908c55/denoiser/demucs.py#L274-L282

If flush function is implemented like above, previous self.conv_state must be used to next wav. Because, self.conv_state variable is initialized only at __init__ method. So, I think that it would be better to use below code at flush method for this.

self.conv_state = None

Please review it and If possible, I can contribute. Thank you.