matsunori39 commited on
Commit
ecddcd1
1 Parent(s): 8503b05
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -23,10 +23,10 @@ def predict_fn(img):
23
  with torch.no_grad():
24
  out = model(img)
25
 
26
- probabilities = torch.nn.functional.softmax(out[0], dim=0)
27
 
28
- values, indices = torch.topk(probabilities, k=5)
29
 
30
  return {LABELS[i]: v.item() for i, v in zip(indices, values)}
31
 
32
- gr.Interface(predict_fn, gr.inputs.Image(type='pli'), outputs='label').launch()
 
23
  with torch.no_grad():
24
  out = model(img)
25
 
26
+ probabilites = torch.nn.functional.softmax(out[0], dim=0)
27
 
28
+ values, indices = torch.topk(probabilites, k=5)
29
 
30
  return {LABELS[i]: v.item() for i, v in zip(indices, values)}
31
 
32
+ gr.Interface(predict_fn, gr.inputs.Image(type='pil'), outputs='label').launch()