app.py
Browse files
app.py
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
import subprocess
|
| 3 |
-
import os
|
| 4 |
-
|
| 5 |
-
def remove_subtitles(video):
|
| 6 |
-
input_path = video
|
| 7 |
-
output_path = "output.mp4"
|
| 8 |
-
cmd = f"python main.py --input_video {input_path} --output_video {output_path}"
|
| 9 |
-
subprocess.run(cmd, shell=True)
|
| 10 |
-
return output_path, output_path
|
| 11 |
-
|
| 12 |
-
with gr.Blocks() as demo:
|
| 13 |
-
gr.Markdown("## 🎬 Video Subtitle Remover (VSR)")
|
| 14 |
-
video_input = gr.Video(label="上传视频")
|
| 15 |
-
run_btn = gr.Button("去字幕")
|
| 16 |
-
video_output = gr.Video(label="处理后视频")
|
| 17 |
-
download = gr.File(label="下载结果")
|
| 18 |
-
run_btn.click(remove_subtitles, inputs=video_input, outputs=[video_output, download])
|
| 19 |
-
|
| 20 |
-
if __name__ == "__main__":
|
| 21 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|