some local changes
This commit is contained in:
Коммит
714091548d
|
@ -1,6 +1,6 @@
|
|||
# Noise Suppression Net (NSNet) baseline inference script
|
||||
|
||||
* As a baseline for Interspeech 2020 Deep Noise Suppression challenge, we will use the recently developed SE method based on Recurrent Neural Network (RNN). For ease of reference, we will call this method as Noise Suppression Net (NSNet).
|
||||
* As a baseline for Interspeech 2020 Deep Noise Suppression challenge, we will use the recently developed SE method based on Recurrent Neural Network (RNN). For ease of reference, we will call this method as Noise Suppression Net (NSNet). The details about this method can be found in the [published paper](https://arxiv.org/pdf/2001.10601.pdf)
|
||||
* This method uses log power spectra as input to predict the enhancement gain per frame using a learning machine based on Gated Recurrent Units (GRU) and fully connected layers. Please refer to the paper for more details of the method.
|
||||
* NSNet is computationally efficient. It only takes 0.16ms to enhance a 20ms frame on an Intel quad core i5 machine using the ONNX run time v1.1 .
|
||||
|
||||
|
@ -22,3 +22,14 @@ From the NSNet-baseline directory, run nsnet_eval_local.py with the following re
|
|||
- --modelpath "Specify the path to the onnx model provided"
|
||||
|
||||
Use default values for the rest. Run to enhance the clips.
|
||||
|
||||
## Citation:
|
||||
The baseline NSNet noise suppression:<br />
|
||||
@misc{xia2020weighted,<br />
|
||||
title={Weighted Speech Distortion Losses for Neural-network-based Real-time Speech Enhancement},<br />
|
||||
author={Yangyang Xia and Sebastian Braun and Chandan K. A. Reddy and Harishchandra Dubey and Ross Cutler and Ivan Tashev},<br />
|
||||
year={2020},<br />
|
||||
eprint={2001.10601},<br />
|
||||
archivePrefix={arXiv},<br />
|
||||
primaryClass={eess.AS}<br />
|
||||
}
|
||||
|
|
Двоичные данные
NSNet-baseline/__pycache__/audiolib.cpython-36.pyc
Двоичные данные
NSNet-baseline/__pycache__/audiolib.cpython-36.pyc
Двоичный файл не отображается.
Двоичные данные
NSNet-baseline/__pycache__/onnx.cpython-36.pyc
Двоичные данные
NSNet-baseline/__pycache__/onnx.cpython-36.pyc
Двоичный файл не отображается.
|
@ -62,10 +62,10 @@ def _main():
|
|||
|
||||
logging.debug("NSNet local workers start with %d input files", len(input_filelist))
|
||||
|
||||
with concurrent.futures.ThreadPoolExecutor(max_workers=args.num_workers) as executor:
|
||||
executor.map(worker, input_filelist, chunksize=args.chunksize)
|
||||
# for fname in input_filelist:
|
||||
# worker(fname)
|
||||
# with concurrent.futures.ThreadPoolExecutor(max_workers=args.num_workers) as executor:
|
||||
# executor.map(worker, input_filelist, chunksize=args.chunksize)
|
||||
for fname in input_filelist:
|
||||
worker(fname)
|
||||
|
||||
logging.info("NSNet local workers complete")
|
||||
|
||||
|
|
25
README.md
25
README.md
|
@ -21,15 +21,28 @@ This repository contains the datasets and scripts required for the DNS challenge
|
|||
* Run python **noisyspeech_synthesizer_singleprocess.py** to synthesize the data.
|
||||
|
||||
## Citation:
|
||||
@misc{ch2020interspeech,
|
||||
title={The INTERSPEECH 2020 Deep Noise Suppression Challenge: Datasets, Subjective Speech Quality and Testing Framework},
|
||||
For the datasets and the DNS challenge:<br />
|
||||
|
||||
@misc{ch2020interspeech,<br />
|
||||
title={The INTERSPEECH 2020 Deep Noise Suppression Challenge: Datasets, Subjective Speech Quality and Testing Framework},<br />
|
||||
author={Chandan K. A. Reddy and Ebrahim Beyrami and Harishchandra Dubey and Vishak Gopal and Roger Cheng and Ross Cutler and Sergiy Matusevych and Robert Aichner and Ashkan Aazami and Sebastian Braun and Puneet Rana and Sriram Srinivasan and Johannes Gehrke},
|
||||
year={2020},
|
||||
eprint={2001.08662},
|
||||
archivePrefix={arXiv},
|
||||
primaryClass={cs.SD}
|
||||
year={2020},<br />
|
||||
eprint={2001.08662},<br />
|
||||
archivePrefix={arXiv},<br />
|
||||
primaryClass={cs.SD}<br />
|
||||
}
|
||||
|
||||
The baseline NSNet noise suppression:<br />
|
||||
@misc{xia2020weighted,<br />
|
||||
title={Weighted Speech Distortion Losses for Neural-network-based Real-time Speech Enhancement},<br />
|
||||
author={Yangyang Xia and Sebastian Braun and Chandan K. A. Reddy and Harishchandra Dubey and Ross Cutler and Ivan Tashev},<br />
|
||||
year={2020},<br />
|
||||
eprint={2001.10601},<br />
|
||||
archivePrefix={arXiv},<br />
|
||||
primaryClass={eess.AS}<br />
|
||||
}
|
||||
|
||||
|
||||
# Contributing
|
||||
|
||||
This project welcomes contributions and suggestions. Most contributions require you to agree to a
|
||||
|
|
|
@ -143,36 +143,48 @@ def main_gen(params, filenum):
|
|||
'''Calls gen_audio() to generate the audio signals, verifies that they meet
|
||||
the requirements, and writes the files to storage'''
|
||||
|
||||
# generate clean speech
|
||||
clean, clean_source_files, clean_clipped_files, clean_low_activity_files = \
|
||||
gen_audio(True, params, filenum)
|
||||
# generate noise
|
||||
noise, noise_source_files, noise_clipped_files, noise_low_activity_files = \
|
||||
gen_audio(False, params, filenum, len(clean))
|
||||
print("Generating file #" + str(filenum))
|
||||
|
||||
# mix clean speech and noise
|
||||
# if specified, use specified SNR value
|
||||
if not params['randomize_snr']:
|
||||
snr = params['snr']
|
||||
# use a randomly sampled SNR value between the specified bounds
|
||||
else:
|
||||
snr = np.random.randint(params['snr_lower'], params['snr_upper'])
|
||||
clean_clipped_files = []
|
||||
clean_low_activity_files = []
|
||||
noise_clipped_files = []
|
||||
noise_low_activity_files = []
|
||||
|
||||
clean_snr, noise_snr, noisy_snr, target_level = snr_mixer(params=params,
|
||||
clean=clean,
|
||||
noise=noise,
|
||||
snr=snr)
|
||||
# Uncomment the below lines if you need segmental SNR and comment the above lines using snr_mixer
|
||||
#clean_snr, noise_snr, noisy_snr, target_level = segmental_snr_mixer(params=params,
|
||||
# clean=clean,
|
||||
# noise=noise,
|
||||
# snr=snr)
|
||||
# unexpected clipping
|
||||
if is_clipped(clean_snr) or is_clipped(noise_snr) or is_clipped(noisy_snr):
|
||||
print("Warning: File #" + str(filenum) + " has unexpected clipping, " + \
|
||||
"returning without writing audio to disk")
|
||||
return [], clean_clipped_files, clean_low_activity_files, \
|
||||
[], noise_clipped_files, noise_low_activity_files
|
||||
while True:
|
||||
# generate clean speech
|
||||
clean, clean_source_files, clean_cf, clean_laf = \
|
||||
gen_audio(True, params, filenum)
|
||||
# generate noise
|
||||
noise, noise_source_files, noise_cf, noise_laf = \
|
||||
gen_audio(False, params, filenum, len(clean))
|
||||
|
||||
clean_clipped_files += clean_cf
|
||||
clean_low_activity_files += clean_laf
|
||||
noise_clipped_files += noise_cf
|
||||
noise_low_activity_files += noise_laf
|
||||
|
||||
# mix clean speech and noise
|
||||
# if specified, use specified SNR value
|
||||
if not params['randomize_snr']:
|
||||
snr = params['snr']
|
||||
# use a randomly sampled SNR value between the specified bounds
|
||||
else:
|
||||
snr = np.random.randint(params['snr_lower'], params['snr_upper'])
|
||||
|
||||
clean_snr, noise_snr, noisy_snr, target_level = snr_mixer(params=params,
|
||||
clean=clean,
|
||||
noise=noise,
|
||||
snr=snr)
|
||||
# Uncomment the below lines if you need segmental SNR and comment the above lines using snr_mixer
|
||||
#clean_snr, noise_snr, noisy_snr, target_level = segmental_snr_mixer(params=params,
|
||||
# clean=clean,
|
||||
# noise=noise,
|
||||
# snr=snr)
|
||||
# unexpected clipping
|
||||
if is_clipped(clean_snr) or is_clipped(noise_snr) or is_clipped(noisy_snr):
|
||||
continue
|
||||
else:
|
||||
break
|
||||
|
||||
# write resultant audio streams to files
|
||||
hyphen = '-'
|
||||
|
@ -252,7 +264,9 @@ def main_body():
|
|||
params['total_hours'] = float(cfg['total_hours'])
|
||||
|
||||
if cfg['fileindex_start'] != 'None' and cfg['fileindex_start'] != 'None':
|
||||
params['num_files'] = int(cfg['fileindex_end'])-int(cfg['fileindex_start'])
|
||||
params['fileindex_start'] = int(cfg['fileindex_start'])
|
||||
params['fileindex_end'] = int(cfg['fileindex_end'])
|
||||
params['num_files'] = int(params['fileindex_end'])-int(params['fileindex_start'])
|
||||
else:
|
||||
params['num_files'] = int((params['total_hours']*60*60)/params['audio_length'])
|
||||
|
||||
|
@ -262,8 +276,11 @@ def main_body():
|
|||
params['noise_activity_threshold'] = float(cfg['noise_activity_threshold'])
|
||||
params['snr_lower'] = int(cfg['snr_lower'])
|
||||
params['snr_upper'] = int(cfg['snr_upper'])
|
||||
<<<<<<< HEAD
|
||||
# params['fileindex_start'] = int(cfg['fileindex_start'])
|
||||
# params['fileindex_end'] = int(cfg['fileindex_end'])
|
||||
=======
|
||||
>>>>>>> f9fdbd480c5c3f8cc5fbaad00028ffecc3e5ea61
|
||||
params['randomize_snr'] = utils.str2bool(cfg['randomize_snr'])
|
||||
params['target_level_lower'] = int(cfg['target_level_lower'])
|
||||
params['target_level_upper'] = int(cfg['target_level_upper'])
|
||||
|
|
|
@ -23,6 +23,7 @@ MAXTRIES = 50
|
|||
MAXFILELEN = 100
|
||||
|
||||
np.random.seed(2)
|
||||
random.seed(3)
|
||||
|
||||
def build_audio(is_clean, params, index, audio_samples_length=-1):
|
||||
'''Construct an audio signal from source files'''
|
||||
|
|
|
@ -43,6 +43,10 @@ def test_zeros_beg_end(audio, num_zeros=16000, low_energy_thresh=LOW_ENERGY_THRE
|
|||
end_segment_energy = 20*np.log10(audio[-num_zeros:]**2).mean()**0.5
|
||||
return beg_segment_energy < low_energy_thresh or end_segment_energy < low_energy_thresh
|
||||
|
||||
def adsp_filtering_test(adsp, without_adsp):
|
||||
diff = adsp - without_adsp
|
||||
if any(val >0.0001 for val in diff):
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
parser = argparse.ArgumentParser()
|
||||
|
|
Загрузка…
Ссылка в новой задаче