Spaces:
Runtime error
Runtime error
agorlanov
commited on
Commit
•
87d93bf
1
Parent(s):
6144c99
fix_readme
Browse files- main_pipeline.py +4 -3
main_pipeline.py
CHANGED
@@ -42,19 +42,20 @@ def save_speaker_audios(segments, denoised_audio_path, out_folder='out', out_f=4
|
|
42 |
return out_wav_paths[:10]
|
43 |
|
44 |
|
45 |
-
def main_pipeline(audio_path):
|
46 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
47 |
|
48 |
denoised_audio_path = denoise(audio_path, device)
|
49 |
segments = diarization(denoised_audio_path)
|
50 |
-
denoised_audio_paths = save_speaker_audios(segments, denoised_audio_path, out_folder
|
51 |
return denoised_audio_path, denoised_audio_paths
|
52 |
|
53 |
|
54 |
if __name__ == '__main__':
|
55 |
parser = argparse.ArgumentParser()
|
56 |
parser.add_argument('--audio-path', default='dialog.mp3', help='Path to audio')
|
|
|
57 |
opt = parser.parse_args()
|
58 |
|
59 |
for _ in tqdm(range(10)):
|
60 |
-
main_pipeline(audio_path=opt.audio_path)
|
|
|
42 |
return out_wav_paths[:10]
|
43 |
|
44 |
|
45 |
+
def main_pipeline(audio_path, out_folder='out'):
|
46 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
47 |
|
48 |
denoised_audio_path = denoise(audio_path, device)
|
49 |
segments = diarization(denoised_audio_path)
|
50 |
+
denoised_audio_paths = save_speaker_audios(segments, denoised_audio_path, out_folder)
|
51 |
return denoised_audio_path, denoised_audio_paths
|
52 |
|
53 |
|
54 |
if __name__ == '__main__':
|
55 |
parser = argparse.ArgumentParser()
|
56 |
parser.add_argument('--audio-path', default='dialog.mp3', help='Path to audio')
|
57 |
+
parser.add_argument('--out-folder-path', default='dialog.mp3', help='Path to audio')
|
58 |
opt = parser.parse_args()
|
59 |
|
60 |
for _ in tqdm(range(10)):
|
61 |
+
main_pipeline(audio_path=opt.audio_path, out_folder=opt.out_folder_path)
|