Spravil commited on
Commit
e0809f6
1 Parent(s): c80591e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -18,7 +18,7 @@ def predict(model_name, image):
18
  input_tensor = transform(image).unsqueeze(0)
19
  with torch.no_grad():
20
  output = model(input_tensor)
21
- output_np = torch.softmax(output)[0].numpy()
22
  return {clsname: prob for clsname, prob in zip(class_names, output_np)}
23
 
24
  interface = gr.Interface(
 
18
  input_tensor = transform(image).unsqueeze(0)
19
  with torch.no_grad():
20
  output = model(input_tensor)
21
+ output_np = torch.softmax(output, dim=1)[0].numpy()
22
  return {clsname: prob for clsname, prob in zip(class_names, output_np)}
23
 
24
  interface = gr.Interface(