simswapNSCR / app.py
NeoSerge's picture
Upload 2 files
0618434 verified
raw
history blame
824 Bytes
import gradio as gr
from PIL import Image
from run_faceswap import run_faceswap
def swap_faces(base_image, face_image):
try:
result = run_faceswap(base_image, face_image)
result_img = Image.fromarray(result)
return result_img
except Exception as e:
return f"Error al generar imagen: {str(e)}"
iface = gr.Interface(
fn=swap_faces,
inputs=[
gr.Image(type="pil", label="Imagen base (cuerpo en pista)"),
gr.Image(type="pil", label="Foto de la cara (webcam)")
],
outputs=gr.Image(type="pil", label="Resultado final"),
title="SimSwap - Reemplazo realista de rostro",
description="Sube una imagen con cuerpo/fondo y una con el rostro a reemplazar. El sistema mantendrá todo igual salvo el rostro."
)
if __name__ == "__main__":
iface.launch()