ganteng88 commited on
Commit
4a047be
·
1 Parent(s): e6e4129

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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 = {name:score for name, score in zip(class_names, 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