Spaces:
Running
Running
salomonsky
commited on
Commit
路
7ea5716
1
Parent(s):
a76642c
Update app.py
Browse files
app.py
CHANGED
@@ -54,16 +54,25 @@ def error_message_fn(error_message):
|
|
54 |
return gr.outputs.Textbox(text=error_message, placeholder="Error")
|
55 |
else:
|
56 |
return None
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
|
61 |
iface = gr.Interface(
|
62 |
-
fn=
|
63 |
inputs=[
|
|
|
64 |
gr.inputs.Textbox(lines=1, label="Nombre", placeholder="Ingresa tu nombre"),
|
65 |
-
gr.inputs.Textbox(lines=1, label="Fecha de Nacimiento", placeholder="DD/MM/AAAA")
|
66 |
-
gr.inputs.Dropdown(choices, label="Selecciona una imagen:", images=thumbnails)
|
67 |
],
|
68 |
outputs=[
|
69 |
gr.outputs.Video(label="Respuesta de Andrea (un minuto aproximadamente)").style(width=256),
|
|
|
54 |
return gr.outputs.Textbox(text=error_message, placeholder="Error")
|
55 |
else:
|
56 |
return None
|
57 |
+
|
58 |
+
def get_image_choices():
|
59 |
+
image_paths = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg"]
|
60 |
+
image_choices = []
|
61 |
+
for image_path in image_paths:
|
62 |
+
image = Image.open(image_path)
|
63 |
+
image.thumbnail((50, 50))
|
64 |
+
image_choices.append(image)
|
65 |
+
return image_choices
|
66 |
+
|
67 |
+
def select_image(image):
|
68 |
+
return image
|
69 |
|
70 |
iface = gr.Interface(
|
71 |
+
fn=select_image,
|
72 |
inputs=[
|
73 |
+
gr.inputs.Image(label="Selecciona una imagen:", type="pil", choices=get_image_choices(), preview="label"),
|
74 |
gr.inputs.Textbox(lines=1, label="Nombre", placeholder="Ingresa tu nombre"),
|
75 |
+
gr.inputs.Textbox(lines=1, label="Fecha de Nacimiento", placeholder="DD/MM/AAAA")
|
|
|
76 |
],
|
77 |
outputs=[
|
78 |
gr.outputs.Video(label="Respuesta de Andrea (un minuto aproximadamente)").style(width=256),
|