Spaces:
Sleeping
Sleeping
add model transforms
Browse files
app.py
CHANGED
@@ -16,9 +16,7 @@ def classify_health(input_img):
|
|
16 |
with torch.no_grad():
|
17 |
image = data_transforms(input_img).unsqueeze(0)
|
18 |
output = model(image)
|
19 |
-
|
20 |
-
print(output.shape)
|
21 |
-
probs = torch.nn.functional.softmax(model(image)[0], dim=0)
|
22 |
idx = probs.argmax(dim=1)
|
23 |
return dict(zip(categories, map(float, probs[0])))
|
24 |
|
|
|
16 |
with torch.no_grad():
|
17 |
image = data_transforms(input_img).unsqueeze(0)
|
18 |
output = model(image)
|
19 |
+
probs = torch.nn.functional.softmax(output, dim=1)
|
|
|
|
|
20 |
idx = probs.argmax(dim=1)
|
21 |
return dict(zip(categories, map(float, probs[0])))
|
22 |
|