Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -42,7 +42,7 @@ def download_video(url):
|
|
42 |
|
43 |
def main(url, clip_type, parameters, progress=gr.Progress()):
|
44 |
|
45 |
-
if clip_type == "dub":
|
46 |
progress(0, desc="Starting")
|
47 |
video = download_video(url)
|
48 |
progress(5, desc="downloaded")
|
@@ -55,21 +55,21 @@ def main(url, clip_type, parameters, progress=gr.Progress()):
|
|
55 |
output_video_file = dub(subtitle_file, video)
|
56 |
progress(100, desc="finish")
|
57 |
os.remove(subtitle_file)
|
58 |
-
else:
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
return output_video_file
|
74 |
|
75 |
with gr.Blocks() as demo:
|
|
|
42 |
|
43 |
def main(url, clip_type, parameters, progress=gr.Progress()):
|
44 |
|
45 |
+
""" if clip_type == "dub":
|
46 |
progress(0, desc="Starting")
|
47 |
video = download_video(url)
|
48 |
progress(5, desc="downloaded")
|
|
|
55 |
output_video_file = dub(subtitle_file, video)
|
56 |
progress(100, desc="finish")
|
57 |
os.remove(subtitle_file)
|
58 |
+
else:"""
|
59 |
+
color, font = parameters.split(",")
|
60 |
+
progress(0, desc="Starting")
|
61 |
+
video = download_video(url)
|
62 |
+
progress(5, desc="downloaded")
|
63 |
+
mp3_file, duration = extract_audio(video)
|
64 |
+
progress(10, desc="extract audio")
|
65 |
+
srt_list = transcribe(mp3_file)
|
66 |
+
progress(35, desc="transcribe")
|
67 |
+
subtitle_file = translate(srt_list)
|
68 |
+
progress(55, desc="translate")
|
69 |
+
print(parameters)
|
70 |
+
output_video_file = video_edit(subtitle_file, video, color, font, input_audio= "audio.mp3")
|
71 |
+
progress(100, desc="finish")
|
72 |
+
os.remove(subtitle_file)
|
73 |
return output_video_file
|
74 |
|
75 |
with gr.Blocks() as demo:
|