Spaces:
Runtime error
Runtime error
Update app/Hackathon_setup/exp_recognition.py
Browse files
app/Hackathon_setup/exp_recognition.py
CHANGED
|
@@ -71,6 +71,8 @@ def get_expression(img):
|
|
| 71 |
model = torch.load(current_path + '/exp_recognition_net.t7', map_location=device)
|
| 72 |
face_det_net.load_state_dict(model['net_dict'])
|
| 73 |
face = trnscm(face).unsqueeze(0)
|
|
|
|
| 74 |
output = face_det_net(face)
|
| 75 |
-
|
|
|
|
| 76 |
return classes[pred]
|
|
|
|
| 71 |
model = torch.load(current_path + '/exp_recognition_net.t7', map_location=device)
|
| 72 |
face_det_net.load_state_dict(model['net_dict'])
|
| 73 |
face = trnscm(face).unsqueeze(0)
|
| 74 |
+
print(face.shape)
|
| 75 |
output = face_det_net(face)
|
| 76 |
+
print(output.shape)
|
| 77 |
+
_, pred = torch.max(output, dim=1)
|
| 78 |
return classes[pred]
|