Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,9 @@ def image_classifier(inp):
|
|
8 |
inp.save("why.png")
|
9 |
sunflower_path = "why.png"
|
10 |
r = asyncio.run(client.zero_shot_image_classification("why.png", labels=["mouth", "other"]))
|
11 |
-
|
|
|
|
|
12 |
|
13 |
|
14 |
demo = gr.Interface(fn=image_classifier, inputs=gr.Image(type="pil"), outputs="label")
|
|
|
8 |
inp.save("why.png")
|
9 |
sunflower_path = "why.png"
|
10 |
r = asyncio.run(client.zero_shot_image_classification("why.png", labels=["mouth", "other"]))
|
11 |
+
c[r[0]["label"]] = r[0]["score"]
|
12 |
+
c[r[1]["label"]] = r[1]["score"]
|
13 |
+
return c
|
14 |
|
15 |
|
16 |
demo = gr.Interface(fn=image_classifier, inputs=gr.Image(type="pil"), outputs="label")
|