Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -113,18 +113,11 @@ with demo:
|
|
113 |
gr.Markdown('''
|
114 |
<div>
|
115 |
<h1 style='text-align: center'>BechdelAI - Dialogue demo</h1>
|
116 |
-
# <img src="logo.png" style="width:200px"/>
|
117 |
</div>
|
118 |
''')
|
119 |
|
120 |
with gr.Row():
|
121 |
-
gr.Markdown('''
|
122 |
-
### Transcribe youtube link using OpenAI Whisper
|
123 |
-
##### 1. Using Open AI's Whisper model to seperate audio into segments and generate transcripts.
|
124 |
-
##### 2. Generating speaker embeddings for each segments.
|
125 |
-
##### 3. Applying agglomerative clustering on the embeddings to identify the speaker for each segment.
|
126 |
-
''')
|
127 |
-
|
128 |
|
129 |
|
130 |
with gr.Row():
|
@@ -132,19 +125,11 @@ with demo:
|
|
132 |
with gr.Column():
|
133 |
# gr.Markdown('''### You can test by following examples:''')
|
134 |
examples = gr.Examples(examples=
|
135 |
-
[
|
136 |
-
"https://www.youtube.com/watch?v
|
137 |
-
"https://www.youtube.com/watch?v=
|
|
|
138 |
label="Examples", inputs=[youtube_url_in])
|
139 |
-
|
140 |
-
with gr.Column():
|
141 |
-
youtube_url_in.render()
|
142 |
-
download_youtube_btn = gr.Button("Download Youtube video")
|
143 |
-
download_youtube_btn.click(get_youtube, [youtube_url_in], [
|
144 |
-
video_in])
|
145 |
-
print(video_in)
|
146 |
-
|
147 |
-
with gr.Column():
|
148 |
youtube_url_in.render()
|
149 |
download_youtube_btn = gr.Button("Download Youtube video")
|
150 |
download_youtube_btn.click(get_youtube, [youtube_url_in], [
|
@@ -154,26 +139,15 @@ with demo:
|
|
154 |
with gr.Column():
|
155 |
video_in.render()
|
156 |
|
|
|
|
|
|
|
157 |
with gr.Row():
|
158 |
with gr.Column():
|
159 |
-
with gr.Column():
|
160 |
-
gr.Markdown('''
|
161 |
-
##### Here you can start the transcription process.
|
162 |
-
##### Please select the source language for transcription.
|
163 |
-
##### You should select a number of speakers for getting better results.
|
164 |
-
''')
|
165 |
selected_source_lang.render()
|
166 |
selected_whisper_model.render()
|
167 |
transcribe_btn = gr.Button("Transcribe audio and diarization")
|
168 |
transcribe_btn.click(speech_to_text, [video_in, selected_source_lang, selected_whisper_model], [output_text])
|
169 |
-
|
170 |
-
|
171 |
-
# with gr.Row():
|
172 |
-
# gr.Markdown('''
|
173 |
-
# ##### Here you will get transcription output
|
174 |
-
# ##### ''')
|
175 |
-
|
176 |
-
with gr.Row():
|
177 |
with gr.Column():
|
178 |
output_text.render()
|
179 |
|
|
|
113 |
gr.Markdown('''
|
114 |
<div>
|
115 |
<h1 style='text-align: center'>BechdelAI - Dialogue demo</h1>
|
|
|
116 |
</div>
|
117 |
''')
|
118 |
|
119 |
with gr.Row():
|
120 |
+
gr.Markdown('''# 🎥 Download Youtube video''')
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
|
122 |
|
123 |
with gr.Row():
|
|
|
125 |
with gr.Column():
|
126 |
# gr.Markdown('''### You can test by following examples:''')
|
127 |
examples = gr.Examples(examples=
|
128 |
+
[
|
129 |
+
"https://www.youtube.com/watch?v=FDFdroN7d0w",
|
130 |
+
"https://www.youtube.com/watch?v=b2f2Kqt_KcE",
|
131 |
+
],
|
132 |
label="Examples", inputs=[youtube_url_in])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
133 |
youtube_url_in.render()
|
134 |
download_youtube_btn = gr.Button("Download Youtube video")
|
135 |
download_youtube_btn.click(get_youtube, [youtube_url_in], [
|
|
|
139 |
with gr.Column():
|
140 |
video_in.render()
|
141 |
|
142 |
+
with gr.Row():
|
143 |
+
gr.Markdown('''# 🎙 Extract text from video''')
|
144 |
+
|
145 |
with gr.Row():
|
146 |
with gr.Column():
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
selected_source_lang.render()
|
148 |
selected_whisper_model.render()
|
149 |
transcribe_btn = gr.Button("Transcribe audio and diarization")
|
150 |
transcribe_btn.click(speech_to_text, [video_in, selected_source_lang, selected_whisper_model], [output_text])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
with gr.Column():
|
152 |
output_text.render()
|
153 |
|