Update app.py
Browse files
app.py
CHANGED
@@ -55,6 +55,9 @@ def process_video(video_file, language_choice):
|
|
55 |
print(sttresult["text"])
|
56 |
print(sttresult["language"])
|
57 |
|
|
|
|
|
|
|
58 |
# Get the segments with start and end times
|
59 |
segments = sttresult['segments']
|
60 |
|
@@ -215,7 +218,7 @@ language_choices = ts.get_languages("google")["en"]
|
|
215 |
gr.Interface(
|
216 |
fn=gradio_interface,
|
217 |
inputs=[
|
218 |
-
gr.Video(label="Upload Video"),
|
219 |
gr.Dropdown(choices=language_choices, label="Choose Language for Translation")
|
220 |
],
|
221 |
outputs=gr.Video(label="Translated Video"),
|
|
|
55 |
print(sttresult["text"])
|
56 |
print(sttresult["language"])
|
57 |
|
58 |
+
if sttresult["language"] == language_choice:
|
59 |
+
return video_file
|
60 |
+
|
61 |
# Get the segments with start and end times
|
62 |
segments = sttresult['segments']
|
63 |
|
|
|
218 |
gr.Interface(
|
219 |
fn=gradio_interface,
|
220 |
inputs=[
|
221 |
+
gr.Video(label="Upload Video", sources=['upload']),
|
222 |
gr.Dropdown(choices=language_choices, label="Choose Language for Translation")
|
223 |
],
|
224 |
outputs=gr.Video(label="Translated Video"),
|