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