Spaces:
Paused
Paused
Update app.py
Browse files8 unmodified lines91011121314151617181920212223242526272829303132333414 unmodified lines49505152535455565758596061625 unmodified lines686970717273748 unmodified linesreturnprint("Installing dependencies...")os.system("pip install -q gfpgan realesrgan basicsr")print("Downloading model...")os.system("git clone https://github.com/vinthony/video-retalking.git vrt")# Download checkpointsos.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.chdir("..")Path("setup_done.txt").touch()14 unmodified linesresult = os.system(cmd)if Path(output).exists():return output, "✅ Done!"else:return None, "❌ Failed to generate"except Exception as e:return None, f"❌ Error: {str(e)}"# Simple Gradio UIdemo = gr.Interface(fn=generate,inputs=[5 unmodified linesgr.Textbox(label="Status")],title="AI Lip Sync Generator",description="Upload a face image and audio to generate lip-synced video")demo.launch()8 unmodified lines910111213141516171819202122232414 unmodified lines39404142434445464748495051525 unmodified lines585960616263648 unmodified linesreturnprint("Installing dependencies...")# Install compatible versionsos.system("pip install -q numpy==1.23.5")os.system("pip install -q gfpgan realesrgan")print("Downloading model...")os.system("git clone https://github.com/OpenTalker/video-retalking.git vrt")# Download checkpointsos.chdir("vrt")os.system("bash scripts/download_models.sh")os.chdir("..")Path("setup_done.txt").touch()14 unmodified linesresult = os.system(cmd)if Path(output).exists():return output, "✅ Video generated successfully!"else:return None, "❌ Failed to generate video"except Exception as e:return None, f"❌ Error: {str(e)}"# Simple UIdemo = gr.Interface(fn=generate,inputs=[5 unmodified linesgr.Textbox(label="Status")],title="AI Lip Sync Generator",description="Upload face image and audio")demo.launch()
app.py+9-19