Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,7 +92,7 @@ def gradio_find(user_img):
|
|
| 92 |
result_imgs = []
|
| 93 |
for i in idxs[:6]:
|
| 94 |
img = dataset[int(i)]['image'].resize((128, 128))
|
| 95 |
-
caption = f"{name}
|
| 96 |
result_imgs.append((img, caption))
|
| 97 |
wiki_text = get_wikipedia_info(name)
|
| 98 |
return result_imgs, wiki_text
|
|
@@ -100,7 +100,7 @@ with gr.Blocks() as demo:
|
|
| 100 |
gr.Markdown("## Which Celebrity Do You Look Like?")
|
| 101 |
with gr.Row():
|
| 102 |
img_input = gr.Image(type="pil", label="Upload your face")
|
| 103 |
-
gallery = gr.Gallery(label="
|
| 104 |
info_box = gr.Textbox(label="Wikipedia Info", lines=10)
|
| 105 |
btn = gr.Button("Find Similar")
|
| 106 |
btn.click(fn=gradio_find, inputs=img_input, outputs=[gallery, info_box])
|
|
|
|
| 92 |
result_imgs = []
|
| 93 |
for i in idxs[:6]:
|
| 94 |
img = dataset[int(i)]['image'].resize((128, 128))
|
| 95 |
+
caption = f"{name}"
|
| 96 |
result_imgs.append((img, caption))
|
| 97 |
wiki_text = get_wikipedia_info(name)
|
| 98 |
return result_imgs, wiki_text
|
|
|
|
| 100 |
gr.Markdown("## Which Celebrity Do You Look Like?")
|
| 101 |
with gr.Row():
|
| 102 |
img_input = gr.Image(type="pil", label="Upload your face")
|
| 103 |
+
gallery = gr.Gallery(label="Similar celebrity", columns=3)
|
| 104 |
info_box = gr.Textbox(label="Wikipedia Info", lines=10)
|
| 105 |
btn = gr.Button("Find Similar")
|
| 106 |
btn.click(fn=gradio_find, inputs=img_input, outputs=[gallery, info_box])
|