Spaces:
Runtime error
Runtime error
agorlanov
commited on
Commit
•
a227627
1
Parent(s):
50a997e
readme
Browse files- README.md +19 -1
- app.py +4 -4
- main_pipeline.py +8 -1
README.md
CHANGED
@@ -9,4 +9,22 @@ app_file: app.py
|
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
pinned: false
|
10 |
---
|
11 |
|
12 |
+
|
13 |
+
How inference:
|
14 |
+
1) [huggingface](https://huggingface.co/spaces/deepkotix/denoise_and_diarization)
|
15 |
+
2) [telegram bot](https://t.me/diarizarion_bot)
|
16 |
+
3) run local inference:
|
17 |
+
1) GUI:
|
18 |
+
`python app.py`
|
19 |
+
2) Inference local:
|
20 |
+
`python main_pipeline.py --audio-path dialog.mp3`
|
21 |
+
|
22 |
+
|
23 |
+
| | inference time for file dialog.mp3 |
|
24 |
+
|-----------------------|:----------------------------------:|
|
25 |
+
| cpu 2v CPU huggingece | 600 s/it |
|
26 |
+
| gpu tesla v100 | 8.23 s/it |
|
27 |
+
|
28 |
+
|
29 |
+
|
30 |
+
|
app.py
CHANGED
@@ -3,8 +3,11 @@ import gradio as gr
|
|
3 |
from main_pipeline import main_pipeline
|
4 |
from scipy.io.wavfile import write
|
5 |
|
6 |
-
title = "audio_denoise and speakser diarization.
|
7 |
|
|
|
|
|
|
|
8 |
|
9 |
def app_pipeline(audio):
|
10 |
audio_path = 'test.wav'
|
@@ -14,9 +17,6 @@ def app_pipeline(audio):
|
|
14 |
return result_diarization + [None] * (10 - len(result_diarization))
|
15 |
|
16 |
|
17 |
-
example_list = [
|
18 |
-
["dialog.mp3"]
|
19 |
-
]
|
20 |
gr.Interface(
|
21 |
app_pipeline,
|
22 |
gr.Audio(type="numpy", label="Input"),
|
|
|
3 |
from main_pipeline import main_pipeline
|
4 |
from scipy.io.wavfile import write
|
5 |
|
6 |
+
title = "audio_denoise and speakser diarization. Faster inference [tg_bot](https://t.me/diarizarion_bot)"
|
7 |
|
8 |
+
example_list = [
|
9 |
+
["dialog.mp3"]
|
10 |
+
]
|
11 |
|
12 |
def app_pipeline(audio):
|
13 |
audio_path = 'test.wav'
|
|
|
17 |
return result_diarization + [None] * (10 - len(result_diarization))
|
18 |
|
19 |
|
|
|
|
|
|
|
20 |
gr.Interface(
|
21 |
app_pipeline,
|
22 |
gr.Audio(type="numpy", label="Input"),
|
main_pipeline.py
CHANGED
@@ -1,6 +1,9 @@
|
|
|
|
1 |
import librosa
|
2 |
import torch
|
3 |
import os
|
|
|
|
|
4 |
from utils.denoise_pipeline import denoise
|
5 |
from utils.diarization_pipeline import diarization
|
6 |
import numpy as np
|
@@ -41,4 +44,8 @@ def main_pipeline(audio_path):
|
|
41 |
|
42 |
|
43 |
if __name__ == '__main__':
|
44 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
import argparse
|
2 |
import librosa
|
3 |
import torch
|
4 |
import os
|
5 |
+
from tqdm import tqdm
|
6 |
+
|
7 |
from utils.denoise_pipeline import denoise
|
8 |
from utils.diarization_pipeline import diarization
|
9 |
import numpy as np
|
|
|
44 |
|
45 |
|
46 |
if __name__ == '__main__':
|
47 |
+
parser = argparse.ArgumentParser()
|
48 |
+
parser.add_argument('--audio-path', default='dialog.mp3', help='Path to audio')
|
49 |
+
opt = parser.parse_args()
|
50 |
+
for _ in tqdm(range(10)):
|
51 |
+
main_pipeline(audio_path=opt.audio_path)
|