Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -20,7 +20,10 @@ def classify_pet(image):
|
|
| 20 |
clip_results = clip_detector(image, candidate_labels=labels_oxford_pets)
|
| 21 |
clip_output = {result['label']: result['score'] for result in clip_results}
|
| 22 |
|
| 23 |
-
return {
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
example_images = [
|
| 26 |
["example_images/dog1.jpeg"],
|
|
@@ -38,8 +41,10 @@ iface = gr.Interface(
|
|
| 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/
|
| 42 |
-
["example_images/leonberger.jpg"]
|
|
|
|
|
|
|
| 43 |
],
|
| 44 |
cache_examples=False
|
| 45 |
)
|
|
|
|
| 20 |
clip_results = clip_detector(image, candidate_labels=labels_oxford_pets)
|
| 21 |
clip_output = {result['label']: result['score'] for result in clip_results}
|
| 22 |
|
| 23 |
+
return {
|
| 24 |
+
"ViT Classification": vit_output,
|
| 25 |
+
"CLIP Zero-Shot Classification": clip_output
|
| 26 |
+
}
|
| 27 |
|
| 28 |
example_images = [
|
| 29 |
["example_images/dog1.jpeg"],
|
|
|
|
| 41 |
description="Upload an image of a pet, and compare results from a trained ViT model and a zero-shot CLIP model.",
|
| 42 |
examples=[
|
| 43 |
["example_images/dog1.jpeg"],
|
| 44 |
+
["example_images/dog2.jpeg"],
|
| 45 |
+
["example_images/leonberger.jpg"],
|
| 46 |
+
["example_images/snow_leopard.jpeg"],
|
| 47 |
+
["example_images/cat.jpg"]
|
| 48 |
],
|
| 49 |
cache_examples=False
|
| 50 |
)
|