Spaces:
Paused
Paused
Update app.py
Browse files8 unmodified lines910111213121415161517181920192021222324252627282930312122232414 unmodified lines39404152424354444546474859495051525 unmodified lines58596071616263648 unmodified lines return print("Installing dependencies...") # Install compatible versions os.system("pip install -q numpy==1.23.5") os.system("pip install -q gfpgan realesrgan basicsr") os.system("pip install -q gfpgan realesrgan") print("Downloading model...") os.system("git clone https://github.com/vinthony/video-retalking.git vrt") os.system("git clone https://github.com/OpenTalker/video-retalking.git vrt") # Download checkpoints os.chdir("vrt") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/30_net_gen.pth -P checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/BFM.zip -P checkpoints/") os.system("unzip -q checkpoints/BFM.zip -d checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/DNet.pt -P checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/ENet.pth -P checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/expression.mat -P checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/face3d_pretrain_epoch_20.pth -P checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/GFPGANv1.3.pth -P checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/GPEN-BFR-512.pth -P checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/LNet.pth -P checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/ParseNet-latest.pth -P checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/RetinaFace-R50.pth -P checkpoints/") os.system("wget https://github.com/vinthony/video-retalking/releases/download/v0.0.1/shape_predictor_68_face_landmarks.dat -P checkpoints/") os.system("bash scripts/download_models.sh") os.chdir("..") Path("setup_done.txt").touch()14 unmodified lines result = os.system(cmd) if Path(output).exists(): return output, "✅ Done!" return output, "✅ Video generated successfully!" else: return None, "❌ Failed to generate" return None, "❌ Failed to generate video" except Exception as e: return None, f"❌ Error: {str(e)}"
# Simple Gradio UI# Simple UIdemo = gr.Interface( fn=generate, inputs=[5 unmodified lines gr.Textbox(label="Status") ], title="AI Lip Sync Generator", description="Upload a face image and audio to generate lip-synced video" description="Upload face image and audio")
demo.launch()app.py+9-19