Spaces:
Running
Running
import os | |
try: | |
import torchaudio | |
except ImportError: | |
os.system("cd ./F5-TTS; pip install -e .") | |
import spaces | |
import logging | |
from datetime import datetime | |
from pathlib import Path | |
import gradio as gr | |
import torch | |
import torchaudio | |
import tempfile | |
log = logging.getLogger() | |
#@spaces.GPU(duration=120) | |
def video_to_audio(video: gr.Video, prompt: str, negative_prompt: str, seed: int, num_steps: int, | |
cfg_strength: float, duration: float): | |
os.system("bash v2a.sh") | |
return "v2a" | |
video_to_audio_tab = gr.Interface( | |
fn=video_to_audio, | |
description=""" | |
Project page: <a href="https://hkchengrex.com/MMAudio/">https://hkchengrex.com/MMAudio/</a><br> | |
Code: <a href="https://github.com/acappemin/DeepAudio-V1">https://github.com/acappemin/DeepAudio-V1</a><br> | |
""", | |
inputs=[ | |
gr.Video(), | |
gr.Text(label='Prompt'), | |
], | |
outputs='playable_video', | |
cache_examples=False, | |
title='MMAudio β Video-to-Audio Synthesis', | |
examples=[ | |
[ | |
'https://huggingface.co/hkchengrex/MMAudio/resolve/main/examples/sora_beach.mp4', | |
'', | |
], | |
]) | |
if __name__ == "__main__": | |
gr.TabbedInterface([video_to_audio_tab], | |
['Video-to-Audio']).launch() | |