|
import gradio as gr |
|
import os |
|
import subprocess |
|
|
|
|
|
def run_wav2lip(video_path, audio_path): |
|
|
|
command = f"python inference.py --face {video_path} --audio {audio_path} --outfile output_result.mp4" |
|
|
|
|
|
subprocess.run(command, shell=True, check=True) |
|
|
|
|
|
return "output_result.mp4" |
|
|
|
|
|
interface = gr.Interface( |
|
fn=run_wav2lip, |
|
inputs=[ |
|
gr.inputs.Video(label="Input Video"), |
|
gr.inputs.Audio(label="Input Audio") |
|
], |
|
outputs=gr.outputs.Video(label="Output Video"), |
|
title="Wav2Lip Model", |
|
description="Upload a video and an audio file to run the Wav2Lip model." |
|
) |
|
|
|
|
|
if __name__ == "__main__": |
|
interface.launch() |
|
|