File size: 678 Bytes
edb0494
1bd1543
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
import os
import subprocess

def remove_subtitles(video):
    input_path = video
    output_path = "output.mp4"
    cmd = f"python main.py --input_video {input_path} --output_video {output_path}"
    subprocess.run(cmd, shell=True)
    return output_path

with gr.Blocks() as demo:
    gr.Markdown("## 🎬 Video Subtitle Remover (VSR)")
    video_input = gr.Video(label="上传视频")
    run_btn = gr.Button("去字幕")
    video_output = gr.Video(label="处理后视频")
    download = gr.File(label="下载结果")
    run_btn.click(remove_subtitles, inputs=video_input, outputs=[video_output, download])

if __name__ == "__main__":
    demo.launch()