Spaces:
Runtime error
Runtime error
Commit ·
0e0b296
1
Parent(s): 06d6683
updated
Browse files
app/Hackathon_setup/exp_recognition.py
CHANGED
|
@@ -71,8 +71,8 @@ def get_expression(img):
|
|
| 71 |
face = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2GRAY))
|
| 72 |
|
| 73 |
with torch.no_grad():
|
| 74 |
-
|
| 75 |
-
|
| 76 |
|
| 77 |
predicted_expression = classes[predicted.item()]
|
| 78 |
|
|
|
|
| 71 |
face = Image.fromarray(cv2.cvtColor(img, cv2.COLOR_BGR2GRAY))
|
| 72 |
|
| 73 |
with torch.no_grad():
|
| 74 |
+
output = face_det_net(face)
|
| 75 |
+
_, predicted = torch.max(output, 1)
|
| 76 |
|
| 77 |
predicted_expression = classes[predicted.item()]
|
| 78 |
|