tsaddev commited on
Commit
4461481
·
1 Parent(s): 2447821

Update app/Hackathon_setup/exp_recognition.py

Browse files
app/Hackathon_setup/exp_recognition.py CHANGED
@@ -70,6 +70,7 @@ def get_expression(img):
70
  face_det_net = facExpRec()
71
  model = torch.load(current_path + '/exp_recognition_net.t7', map_location=device)
72
  face_det_net.load_state_dict(model['net_dict'])
73
- output = face_det_net(trnscm(face))
 
74
  _, pred = torch.max(output)
75
  return classes[pred]
 
70
  face_det_net = facExpRec()
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
  _, pred = torch.max(output)
76
  return classes[pred]