Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,8 +44,12 @@ def inference(input_image):
|
|
| 44 |
# Read the categories
|
| 45 |
#with open("dog_cat.txt", "r") as f:
|
| 46 |
#categories = [s.strip() for s in f.readlines()]
|
| 47 |
-
with open("dog_cat.txt", "r") as f:
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
# Show top categories per image
|
| 50 |
top5_prob, top5_catid = torch.topk(probabilities, 2)
|
| 51 |
result = {}
|
|
|
|
| 44 |
# Read the categories
|
| 45 |
#with open("dog_cat.txt", "r") as f:
|
| 46 |
#categories = [s.strip() for s in f.readlines()]
|
| 47 |
+
#with open("dog_cat.txt", "r") as f:
|
| 48 |
+
categories = []
|
| 49 |
+
categories.append("cat")
|
| 50 |
+
categories.append("dog")
|
| 51 |
+
|
| 52 |
+
#categories = [s.strip() for s in f.readlines()]
|
| 53 |
# Show top categories per image
|
| 54 |
top5_prob, top5_catid = torch.topk(probabilities, 2)
|
| 55 |
result = {}
|