Spaces:
Runtime error
Runtime error
MCP and Zero ready
Browse files
app.py
CHANGED
|
@@ -82,6 +82,22 @@ from latentsync.whisper.audio2feature import Audio2Feature
|
|
| 82 |
|
| 83 |
@spaces.GPU(duration=180)
|
| 84 |
def main(video_path, audio_path, progress=gr.Progress(track_tqdm=True)):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
inference_ckpt_path = "checkpoints/latentsync_unet.pt"
|
| 86 |
unet_config_path = "configs/unet/second_stage.yaml"
|
| 87 |
config = OmegaConf.load(unet_config_path)
|
|
|
|
| 82 |
|
| 83 |
@spaces.GPU(duration=180)
|
| 84 |
def main(video_path, audio_path, progress=gr.Progress(track_tqdm=True)):
|
| 85 |
+
"""
|
| 86 |
+
Perform lip-sync video generation using an input video and a separate audio track.
|
| 87 |
+
|
| 88 |
+
This function takes an input video (usually a person speaking) and an audio file,
|
| 89 |
+
and synchronizes the video frames so that the lips of the speaker match the audio content.
|
| 90 |
+
It uses a latent diffusion model-based pipeline (LatentSync) for audio-conditioned lip synchronization.
|
| 91 |
+
|
| 92 |
+
Args:
|
| 93 |
+
video_path (str): File path to the input video in MP4 format.
|
| 94 |
+
audio_path (str): File path to the input audio file (e.g., WAV or MP3).
|
| 95 |
+
progress (gr.Progress, optional): Gradio progress tracker for UI feedback (auto-injected).
|
| 96 |
+
|
| 97 |
+
Returns:
|
| 98 |
+
str: File path to the generated output video with lip synchronization applied.
|
| 99 |
+
"""
|
| 100 |
+
|
| 101 |
inference_ckpt_path = "checkpoints/latentsync_unet.pt"
|
| 102 |
unet_config_path = "configs/unet/second_stage.yaml"
|
| 103 |
config = OmegaConf.load(unet_config_path)
|