ganteng88 commited on
Commit
80ffc34
·
1 Parent(s): 5f4e838

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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[i]: score for i, score in enumerate(result)}
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