Update app.py
Browse files
app.py
CHANGED
@@ -13,8 +13,8 @@ def image_classifier(inp):
|
|
13 |
r = asyncio.run(client.zero_shot_image_classification("why.png", candidate_labels=["mouth", "teeth", "not mouth"]))
|
14 |
c = {}
|
15 |
a = r[0]["score"] + r[1]["score"] + r[2]["score"]
|
16 |
-
c[r[0]["label"]] = (r[0]["score"] + r[1]["score"]) / a
|
17 |
-
c[r[2]["label"]] = r[2]["score"] / a
|
18 |
return c
|
19 |
|
20 |
|
|
|
13 |
r = asyncio.run(client.zero_shot_image_classification("why.png", candidate_labels=["mouth", "teeth", "not mouth"]))
|
14 |
c = {}
|
15 |
a = r[0]["score"] + r[1]["score"] + r[2]["score"]
|
16 |
+
c[r[0]["label"]] = (r[0]["score"] + r[1]["score"]) / a
|
17 |
+
c[r[2]["label"]] = r[2]["score"] / a
|
18 |
return c
|
19 |
|
20 |
|