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