Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from PIL import Image
|
3 |
+
|
4 |
+
def vestir_prenda(foto_usuario, prenda):
|
5 |
+
maniqui = Image.open(foto_usuario).convert("RGBA")
|
6 |
+
prenda_imagen = Image.open(prenda).convert("RGBA")
|
7 |
+
prenda_imagen = prenda_imagen.resize(maniqui.size)
|
8 |
+
combinado = Image.blend(maniqui, prenda_imagen, alpha=0.5)
|
9 |
+
return combinado
|
10 |
+
|
11 |
+
iface = gr.Interface(
|
12 |
+
fn=vestir_prenda,
|
13 |
+
inputs=[
|
14 |
+
gr.Image(label="Tu maniqu铆"),
|
15 |
+
gr.Image(label="Imagen de la prenda")
|
16 |
+
],
|
17 |
+
outputs="image",
|
18 |
+
title="Probador Virtual AI",
|
19 |
+
description="Sube tu maniqu铆 y una prenda para ver c贸mo te queda."
|
20 |
+
)
|
21 |
+
|
22 |
+
iface.launch()
|