Cahlil-Togonon
commited on
Commit
·
3f44072
1
Parent(s):
2e73e74
added application file
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from pyannote.audio import Pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
def diarization():
|
5 |
+
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
|
6 |
+
output = pipeline("audio.wav")
|
7 |
+
answer = ""
|
8 |
+
for turn, _, speaker in output.itertracks(yield_label=True):
|
9 |
+
answer += "{} said something starting from {} and ends on {}\n".format(speaker,turn.start,turn.end)
|
10 |
+
return answer
|
11 |
+
|
12 |
+
app = gr.Interface(fn=diarization, inputs="audio", outputs="text")
|
13 |
+
app.launch()
|