Spaces:
Sleeping
Sleeping
updated app.py
Browse files
app.py
CHANGED
@@ -37,8 +37,9 @@ def predict(image, model, device):
|
|
37 |
with torch.no_grad():
|
38 |
outputs = model(image_t)
|
39 |
probs = torch.softmax(outputs, dim=1)
|
40 |
-
conf, predicted = torch.max(probs, 1)
|
41 |
-
return class_names[predicted.item()], conf.item()
|
|
|
42 |
|
43 |
def main():
|
44 |
st.title("Human Action Recognition App")
|
|
|
37 |
with torch.no_grad():
|
38 |
outputs = model(image_t)
|
39 |
probs = torch.softmax(outputs, dim=1)
|
40 |
+
conf, predicted = torch.max(probs, dim=1)
|
41 |
+
return class_names[predicted.item()], float(conf.item()) # type: ignore
|
42 |
+
|
43 |
|
44 |
def main():
|
45 |
st.title("Human Action Recognition App")
|