Spaces:
Running
Running
| import gradio as gr | |
| import subprocess | |
| def swap_faces(source_image, target_image): | |
| command = [ | |
| "python", "infer.py", | |
| "--source", source_image, | |
| "--target", target_image, | |
| "--output", "output.jpg" | |
| ] | |
| subprocess.run(command) | |
| return "output.jpg" | |
| iface = gr.Interface( | |
| fn=swap_faces, | |
| inputs=["image", "image"], | |
| outputs="image", | |
| title="FaceFusion", | |
| description="Upload two images and swap faces using FaceFusion." | |
| ) | |
| iface.launch(server_name="0.0.0.0", server_port=7860) | |