Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,13 +22,26 @@ def classify_pet(image):
|
|
| 22 |
|
| 23 |
return {"ViT Classification": vit_output, "CLIP Zero-Shot Classification": clip_output}
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
iface = gr.Interface(
|
| 26 |
fn=classify_pet,
|
| 27 |
inputs=gr.Image(type="filepath"),
|
| 28 |
outputs=gr.JSON(),
|
| 29 |
title="Pet Classification Comparison",
|
| 30 |
description="Upload an image of a pet, and compare results from a trained ViT model and a zero-shot CLIP model.",
|
| 31 |
-
examples=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
)
|
| 33 |
|
| 34 |
iface.launch()
|
|
|
|
| 22 |
|
| 23 |
return {"ViT Classification": vit_output, "CLIP Zero-Shot Classification": clip_output}
|
| 24 |
|
| 25 |
+
example_images = [
|
| 26 |
+
["example_images/dog1.jpeg"],
|
| 27 |
+
["example_images/dog2.jpeg"],
|
| 28 |
+
["example_images/leonberger.jpg"],
|
| 29 |
+
["example_images/snow_leopard.jpeg"],
|
| 30 |
+
["example_images/cat.jpg"]
|
| 31 |
+
]
|
| 32 |
+
|
| 33 |
iface = gr.Interface(
|
| 34 |
fn=classify_pet,
|
| 35 |
inputs=gr.Image(type="filepath"),
|
| 36 |
outputs=gr.JSON(),
|
| 37 |
title="Pet Classification Comparison",
|
| 38 |
description="Upload an image of a pet, and compare results from a trained ViT model and a zero-shot CLIP model.",
|
| 39 |
+
examples=[
|
| 40 |
+
["example_images/dog1.jpeg"],
|
| 41 |
+
["example_images/cat.jpg"],
|
| 42 |
+
["example_images/leonberger.jpg"]
|
| 43 |
+
],
|
| 44 |
+
cache_examples=False
|
| 45 |
)
|
| 46 |
|
| 47 |
iface.launch()
|