A package for training audio denoisers
Project description
Denoisers
Denoisers is a denoising library for audio with a focus on simplicity and ease of use. There are two major types of architectures available. WaveUNet for waveform denoising and UNet for spectrogram denoising.
Demo
Gradio demo here
Usage/Examples
pip install denoisers
import torch
import torchaudio
from denoisers import WaveUNetModel
from tqdm import tqdm
model = WaveUNetModel.from_pretrained("wrice/waveunet-vctk-24khz")
audio, sr = torchaudio.load("noisy_audio.wav")
if sr != model.config.sample_rate:
audio = torchaudio.functional.resample(audio, sr, model.config.sample_rate)
chunk_size = model.config.max_length
padding = abs(audio.size(-1) % chunk_size - chunk_size)
padded = torch.nn.functional.pad(audio, (0, padding))
clean = []
for i in tqdm(range(0, padded.shape[-1], chunk_size)):
audio_chunk = padded[:, i:i+chunk_size]
with torch.no_grad():
clean_chunk = model(audio_chunk[None]).logits
clean.append(clean_chunk.squeeze(0))
denoised = torch.concat(clean, 1)[:, :audio.shape[-1]]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
denoisers-0.1.6.tar.gz
(19.5 kB
view hashes)
Built Distribution
denoisers-0.1.6-py3-none-any.whl
(29.0 kB
view hashes)
Close
Hashes for denoisers-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c3e73a7514094d9921edc0cb76f0bd77372f947db2eb3c5762514578dc5bda62 |
|
MD5 | 92a7bc373d55e6d51eebecf791a17bfb |
|
BLAKE2b-256 | 4186e50429c338a1b082d26756013e5919e9881f3682485a112866d567e1bc1b |