Spaces:
Running
Running
Commit
·
3a47819
1
Parent(s):
495ebd3
Update app.py
Browse files
app.py
CHANGED
@@ -51,17 +51,14 @@ def error_message_fn(error_message):
|
|
51 |
else:
|
52 |
return None
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
def get_images():
|
59 |
-
images = []
|
60 |
-
for image_path in choices:
|
61 |
image = Image.open(image_path)
|
62 |
image.thumbnail((50, 50))
|
63 |
-
|
64 |
-
return
|
65 |
|
66 |
def select_image(image):
|
67 |
return image
|
@@ -69,7 +66,7 @@ def select_image(image):
|
|
69 |
iface = gr.Interface(
|
70 |
fn=select_image,
|
71 |
inputs=[
|
72 |
-
gr.inputs.
|
73 |
gr.inputs.Textbox(lines=1, label="Nombre", placeholder="Ingresa tu nombre"),
|
74 |
gr.inputs.Textbox(lines=1, label="Fecha de Nacimiento", placeholder="DD/MM/AAAA")
|
75 |
],
|
|
|
51 |
else:
|
52 |
return None
|
53 |
|
54 |
+
def get_image_choices():
|
55 |
+
image_paths = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg"]
|
56 |
+
image_choices = []
|
57 |
+
for image_path in image_paths:
|
|
|
|
|
|
|
58 |
image = Image.open(image_path)
|
59 |
image.thumbnail((50, 50))
|
60 |
+
image_choices.append((image_path, image))
|
61 |
+
return image_choices
|
62 |
|
63 |
def select_image(image):
|
64 |
return image
|
|
|
66 |
iface = gr.Interface(
|
67 |
fn=select_image,
|
68 |
inputs=[
|
69 |
+
gr.inputs.Radio(label="Selecciona una imagen:", choices=get_image_choices(), default=get_image_choices()[0], type="tuple"),
|
70 |
gr.inputs.Textbox(lines=1, label="Nombre", placeholder="Ingresa tu nombre"),
|
71 |
gr.inputs.Textbox(lines=1, label="Fecha de Nacimiento", placeholder="DD/MM/AAAA")
|
72 |
],
|