Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,7 @@ def inference(input_image):
|
|
29 |
# The output has unnormalized scores. To get probabilities, you can run a softmax on it.
|
30 |
probabilities = torch.nn.functional.softmax(output[0], dim=0)
|
31 |
# Download ImageNet labels
|
32 |
-
|
33 |
# Read the categories
|
34 |
with open("imagenet_classes.txt", "r") as f:
|
35 |
categories = [s.strip() for s in f.readlines()]
|
|
|
29 |
# The output has unnormalized scores. To get probabilities, you can run a softmax on it.
|
30 |
probabilities = torch.nn.functional.softmax(output[0], dim=0)
|
31 |
# Download ImageNet labels
|
32 |
+
os.system("wget https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt")
|
33 |
# Read the categories
|
34 |
with open("imagenet_classes.txt", "r") as f:
|
35 |
categories = [s.strip() for s in f.readlines()]
|