Spaces:
Runtime error
Runtime error
Delete demo.py
Browse files
demo.py
DELETED
|
@@ -1,70 +0,0 @@
|
|
| 1 |
-
from clearvoice import ClearVoice
|
| 2 |
-
|
| 3 |
-
##-----------------demo one: use one model ----------------------------------
|
| 4 |
-
if False:
|
| 5 |
-
myClearVoice = ClearVoice(task='speech_enhancement', model_names=['MossFormer2_SE_48K'])
|
| 6 |
-
|
| 7 |
-
##1sd calling method: process an input waveform and return output waveform, then write to output.wav
|
| 8 |
-
#output_wav = myClearVoice(input_path='input.wav', online_write=False)
|
| 9 |
-
#myClearVoice.write(output_wav, output_path='output.wav')
|
| 10 |
-
|
| 11 |
-
##2nd calling method: process all wav files in 'path_to_input_wavs/' and write outputs to 'path_to_output_wavs'
|
| 12 |
-
myClearVoice(input_path='path_to_input_wavs', online_write=True, output_path='path_to_output_wavs')
|
| 13 |
-
|
| 14 |
-
##3rd calling method: process wav files listed in .scp file, and write outputs to 'path_to_output_waves/'
|
| 15 |
-
#myClearVoice(input_path='scp/cv_webrtc_test_set_20200521_16k.scp', online_write=True, output_path='path_to_output_scp')
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
##----------------Demo two: use multiple models -----------------------------------
|
| 19 |
-
if False:
|
| 20 |
-
myClearVoice = ClearVoice(task='speech_enhancement', model_names=['FRCRN_SE_16K']) #, 'MossFormerGAN_SE_16K'])
|
| 21 |
-
|
| 22 |
-
##1sd calling method: process the waveform from input.wav and return output waveform, then write to output.wav
|
| 23 |
-
#output_wav = myClearVoice(input_path='input.wav', online_write=False)
|
| 24 |
-
#myClearVoice.write(output_wav, output_path='output.wav')
|
| 25 |
-
|
| 26 |
-
##2nd calling method: process all wav files in 'path_to_input_wavs/' and write outputs to 'path_to_output_wavs'
|
| 27 |
-
myClearVoice(input_path='path_to_input_wavs', online_write=True, output_path='path_to_output_wavs')
|
| 28 |
-
|
| 29 |
-
##3rd calling method: process wav files listed in .scp file, and write outputs to 'path_to_output_waves/'
|
| 30 |
-
#myClearVoice(input_path='scp/cv_webrtc_test_set_20200521_16k.scp', online_write=True, output_path='path_to_output_scp')
|
| 31 |
-
|
| 32 |
-
if False:
|
| 33 |
-
myClearVoice = ClearVoice(task='speech_enhancement', model_names=['MossFormerGAN_SE_16K'])
|
| 34 |
-
|
| 35 |
-
##1sd calling method: process the waveform from input.wav and return output waveform, then write to output.wav
|
| 36 |
-
#output_wav = myClearVoice(input_path='input.wav', online_write=False)
|
| 37 |
-
#myClearVoice.write(output_wav, output_path='output.wav')
|
| 38 |
-
|
| 39 |
-
##2nd calling method: process all wav files in 'path_to_input_wavs/' and write outputs to 'path_to_output_wavs'
|
| 40 |
-
myClearVoice(input_path='path_to_input_wavs', online_write=True, output_path='path_to_output_wavs')
|
| 41 |
-
|
| 42 |
-
##3rd calling method: process wav files listed in .scp file, and write outputs to 'path_to_output_waves/'
|
| 43 |
-
#myClearVoice(input_path='scp/cv_webrtc_test_set_20200521_16k.scp', online_write=True, output_path='path_to_output_scp')
|
| 44 |
-
|
| 45 |
-
##----------------Demo three: use one model for speech separation -----------------------------------
|
| 46 |
-
if True:
|
| 47 |
-
myClearVoice = ClearVoice(task='speech_separation', model_names=['MossFormer2_SS_16K'])
|
| 48 |
-
|
| 49 |
-
##1sd calling method: process an input waveform and return output waveform, then write to output.wav
|
| 50 |
-
#output_wav = myClearVoice(input_path='input.wav', online_write=False)
|
| 51 |
-
#myClearVoice.write(output_wav, output_path='output.wav')
|
| 52 |
-
|
| 53 |
-
#2nd calling method: process all wav files in 'path_to_input_wavs/' and write outputs to 'path_to_output_wavs'
|
| 54 |
-
#myClearVoice(input_path='path_to_input_wavs_ss', online_write=True, output_path='path_to_output_wavs')
|
| 55 |
-
|
| 56 |
-
##3rd calling method: process wav files listed in .scp file, and write outputs to 'path_to_output_waves/'
|
| 57 |
-
myClearVoice(input_path='scp/libri_2mix_tt.scp', online_write=True, output_path='path_to_output_scp')
|
| 58 |
-
|
| 59 |
-
##----------------Demo four: use one model for audio-visual target speaker extraction -----------------------------------
|
| 60 |
-
if False:
|
| 61 |
-
myClearVoice = ClearVoice(task='target_speaker_extraction', model_names=['AV_MossFormer2_TSE_16K'])
|
| 62 |
-
|
| 63 |
-
# #1sd calling method: process an input video and return output video, then write outputs to 'path_to_output_videos_tse'
|
| 64 |
-
# output_wav = myClearVoice(input_path='path_to_input_videos_tse/004.MOV', online_write=True, output_path='path_to_output_videos_tse')
|
| 65 |
-
|
| 66 |
-
#2nd calling method: process all video files in 'path_to_input_videos/' and write outputs to 'path_to_output_videos_tse'
|
| 67 |
-
myClearVoice(input_path='path_to_input_videos_tse', online_write=True, output_path='path_to_output_videos_tse')
|
| 68 |
-
|
| 69 |
-
# #3rd calling method: process video files listed in .scp file, and write outputs to 'path_to_output_videos_tse/'
|
| 70 |
-
# myClearVoice(input_path='scp/video_samples.scp', online_write=True, output_path='path_to_output_videos_tse')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|