Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -216,7 +216,7 @@ def image_classifier(inp):
|
|
216 |
# postprocess
|
217 |
result = torch.nn.functional.softmax(result, dim=1) # apply softmax
|
218 |
result = result[0].detach().numpy().tolist() # take the first batch
|
219 |
-
labeled_result = {
|
220 |
|
221 |
return labeled_result
|
222 |
|
|
|
216 |
# postprocess
|
217 |
result = torch.nn.functional.softmax(result, dim=1) # apply softmax
|
218 |
result = result[0].detach().numpy().tolist() # take the first batch
|
219 |
+
labeled_result = {class_names[i]: score for i, score in enumerate(result)}
|
220 |
|
221 |
return labeled_result
|
222 |
|