Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,6 +47,16 @@ def inference(input_image):
|
|
| 47 |
# Read the categories
|
| 48 |
with open("artist_classes.txt", "r") as f:
|
| 49 |
categories = [s.strip() for s in f.readlines()]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
# Show top categories per image
|
| 51 |
top5_prob, top5_catid = torch.topk(probabilities, 6)
|
| 52 |
result = {}
|
|
|
|
| 47 |
# Read the categories
|
| 48 |
with open("artist_classes.txt", "r") as f:
|
| 49 |
categories = [s.strip() for s in f.readlines()]
|
| 50 |
+
|
| 51 |
+
categories = {
|
| 52 |
+
0:vanGogh,
|
| 53 |
+
1:Monet,
|
| 54 |
+
2:Leonardo da Vinci,
|
| 55 |
+
3:Rembrandt,
|
| 56 |
+
4:Pablo Picasso,
|
| 57 |
+
5:Salvador Dali
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
# Show top categories per image
|
| 61 |
top5_prob, top5_catid = torch.topk(probabilities, 6)
|
| 62 |
result = {}
|