Spaces:
Running
on
Zero
Running
on
Zero
| 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() | |