Spaces:
Sleeping
Sleeping
Matan Kriel
commited on
Commit
·
fecdfaf
1
Parent(s):
648852a
updated app
Browse files- app.py +8 -8
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -88,7 +88,7 @@ def find_best_matches(user_image):
|
|
| 88 |
# Pad with empty data if we found fewer than 3 matches
|
| 89 |
while len(output_data) < 6:
|
| 90 |
output_data.append(None)
|
| 91 |
-
output_data.append("No Match")
|
| 92 |
|
| 93 |
# Return 6 items: (Img1, Lbl1, Img2, Lbl2, Img3, Lbl3)
|
| 94 |
return output_data[0], output_data[1], output_data[2], output_data[3], output_data[4], output_data[5]
|
|
@@ -121,14 +121,14 @@ with gr.Blocks(title="Famous Face Matcher") as demo:
|
|
| 121 |
|
| 122 |
with gr.Column():
|
| 123 |
with gr.Row():
|
| 124 |
-
out1_img = gr.Image(label="#1 Match"
|
| 125 |
-
out1_lbl = gr.
|
| 126 |
with gr.Row():
|
| 127 |
-
out2_img = gr.Image(label="#2 Match"
|
| 128 |
-
out2_lbl = gr.
|
| 129 |
with gr.Row():
|
| 130 |
-
out3_img = gr.Image(label="#3 Match"
|
| 131 |
-
out3_lbl = gr.
|
| 132 |
|
| 133 |
# FIX: Outputs must be a FLAT list, not a list of tuples
|
| 134 |
btn.click(
|
|
@@ -137,4 +137,4 @@ with gr.Blocks(title="Famous Face Matcher") as demo:
|
|
| 137 |
outputs=[out1_img, out1_lbl, out2_img, out2_lbl, out3_img, out3_lbl]
|
| 138 |
)
|
| 139 |
|
| 140 |
-
demo.launch()
|
|
|
|
| 88 |
# Pad with empty data if we found fewer than 3 matches
|
| 89 |
while len(output_data) < 6:
|
| 90 |
output_data.append(None)
|
| 91 |
+
output_data.append("**No Match**")
|
| 92 |
|
| 93 |
# Return 6 items: (Img1, Lbl1, Img2, Lbl2, Img3, Lbl3)
|
| 94 |
return output_data[0], output_data[1], output_data[2], output_data[3], output_data[4], output_data[5]
|
|
|
|
| 121 |
|
| 122 |
with gr.Column():
|
| 123 |
with gr.Row():
|
| 124 |
+
out1_img = gr.Image(label="#1 Match")
|
| 125 |
+
out1_lbl = gr.Markdown()
|
| 126 |
with gr.Row():
|
| 127 |
+
out2_img = gr.Image(label="#2 Match")
|
| 128 |
+
out2_lbl = gr.Markdown()
|
| 129 |
with gr.Row():
|
| 130 |
+
out3_img = gr.Image(label="#3 Match")
|
| 131 |
+
out3_lbl = gr.Markdown()
|
| 132 |
|
| 133 |
# FIX: Outputs must be a FLAT list, not a list of tuples
|
| 134 |
btn.click(
|
|
|
|
| 137 |
outputs=[out1_img, out1_lbl, out2_img, out2_lbl, out3_img, out3_lbl]
|
| 138 |
)
|
| 139 |
|
| 140 |
+
demo.launch(show_api=False)
|
requirements.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
gradio
|
| 2 |
huggingface_hub>=0.25.1,<1.0.0
|
| 3 |
deepface
|
| 4 |
tf-keras
|
|
|
|
| 1 |
+
gradio==4.40.0
|
| 2 |
huggingface_hub>=0.25.1,<1.0.0
|
| 3 |
deepface
|
| 4 |
tf-keras
|