Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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(
|