Spaces:
Running
Running
sebastiansarasti
commited on
Commit
•
9d3403f
1
Parent(s):
a50b87e
Update app.py
Browse files
app.py
CHANGED
@@ -53,11 +53,11 @@ def interface_fn(mode, input_text, input_image, top_k):
|
|
53 |
# Determinar qué input usar basado en el modo
|
54 |
if mode == "text":
|
55 |
if not input_text.strip():
|
56 |
-
return [], "
|
57 |
input_data = input_text
|
58 |
else: # mode == "image"
|
59 |
if input_image is None:
|
60 |
-
return [], "
|
61 |
input_data = process_image_for_encoder_gradio(input_image, is_bytes=False)
|
62 |
|
63 |
# Show the input data
|
@@ -126,8 +126,8 @@ with gr.Blocks() as demo:
|
|
126 |
with gr.Row():
|
127 |
with gr.Column(scale=1):
|
128 |
input_text = gr.Textbox(
|
129 |
-
label="
|
130 |
-
placeholder="
|
131 |
lines=3
|
132 |
)
|
133 |
|
@@ -136,15 +136,15 @@ with gr.Blocks() as demo:
|
|
136 |
maximum=20,
|
137 |
value=5,
|
138 |
step=1,
|
139 |
-
label="
|
140 |
-
info="
|
141 |
)
|
142 |
|
143 |
-
search_button = gr.Button("
|
144 |
|
145 |
with gr.Column(scale=1):
|
146 |
output_gallery = gr.Gallery(
|
147 |
-
label="
|
148 |
columns=3,
|
149 |
height="auto"
|
150 |
)
|
|
|
53 |
# Determinar qué input usar basado en el modo
|
54 |
if mode == "text":
|
55 |
if not input_text.strip():
|
56 |
+
return [], "Please, add the description of the clothes to search."
|
57 |
input_data = input_text
|
58 |
else: # mode == "image"
|
59 |
if input_image is None:
|
60 |
+
return [], "Please, select an image"
|
61 |
input_data = process_image_for_encoder_gradio(input_image, is_bytes=False)
|
62 |
|
63 |
# Show the input data
|
|
|
126 |
with gr.Row():
|
127 |
with gr.Column(scale=1):
|
128 |
input_text = gr.Textbox(
|
129 |
+
label="Search text",
|
130 |
+
placeholder="Insert your description here...",
|
131 |
lines=3
|
132 |
)
|
133 |
|
|
|
136 |
maximum=20,
|
137 |
value=5,
|
138 |
step=1,
|
139 |
+
label="Number of images",
|
140 |
+
info="How many images do you want to see?"
|
141 |
)
|
142 |
|
143 |
+
search_button = gr.Button("Search")
|
144 |
|
145 |
with gr.Column(scale=1):
|
146 |
output_gallery = gr.Gallery(
|
147 |
+
label="Similar images",
|
148 |
columns=3,
|
149 |
height="auto"
|
150 |
)
|