Spaces:
Running
Running
sashavor
commited on
Commit
·
c3eae7d
1
Parent(s):
bf789ff
adding examples
Browse files
app.py
CHANGED
|
@@ -41,7 +41,6 @@ def query(image, top_k=4):
|
|
| 41 |
with gr.Blocks() as demo:
|
| 42 |
gr.Markdown("# Find my Butterfly 🦋")
|
| 43 |
gr.Markdown("## Use this Space to find your butterfly, based on the [iNaturalist butterfly dataset](https://huggingface.co/datasets/huggan/inat_butterflies_top10k)!")
|
| 44 |
-
examples=["elton.jpg", "ken.jpg", "gaga.jpg", "taylor.jpg"]
|
| 45 |
with gr.Row():
|
| 46 |
with gr.Column(min_width= 900):
|
| 47 |
inputs = gr.Image(shape=(800, 1600))
|
|
@@ -49,7 +48,14 @@ with gr.Blocks() as demo:
|
|
| 49 |
with gr.Column():
|
| 50 |
outputs=gr.Gallery().style(grid=[2], height="auto")
|
| 51 |
labels = gr.Label()
|
| 52 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
btn.click(query, inputs, [outputs, labels])
|
| 54 |
|
| 55 |
demo.launch()
|
|
|
|
| 41 |
with gr.Blocks() as demo:
|
| 42 |
gr.Markdown("# Find my Butterfly 🦋")
|
| 43 |
gr.Markdown("## Use this Space to find your butterfly, based on the [iNaturalist butterfly dataset](https://huggingface.co/datasets/huggan/inat_butterflies_top10k)!")
|
|
|
|
| 44 |
with gr.Row():
|
| 45 |
with gr.Column(min_width= 900):
|
| 46 |
inputs = gr.Image(shape=(800, 1600))
|
|
|
|
| 48 |
with gr.Column():
|
| 49 |
outputs=gr.Gallery().style(grid=[2], height="auto")
|
| 50 |
labels = gr.Label()
|
| 51 |
+
gr.Markdown("### Image Examples")
|
| 52 |
+
gr.Examples(
|
| 53 |
+
examples=["elton.jpg", "ken.jpg", "gaga.jpg", "taylor.jpg"],
|
| 54 |
+
inputs=inputs,
|
| 55 |
+
outputs=[outputs,labels],
|
| 56 |
+
fn=query,
|
| 57 |
+
cache_examples=True,
|
| 58 |
+
)
|
| 59 |
btn.click(query, inputs, [outputs, labels])
|
| 60 |
|
| 61 |
demo.launch()
|