vrvundyala commited on
Commit
648876d
·
1 Parent(s): 1d2dca4

face expressions

Browse files
app/Hackathon_setup/exp_recognition.py CHANGED
@@ -69,7 +69,9 @@ def get_expression(img):
69
  optimizer = torch.optim.Adam(model.parameters(), lr=0.0001)
70
 
71
  # Load the checkpoint
72
- checkpoint = torch.load('resnet_expression_recognition.pth', map_location=device)
 
 
73
 
74
  # Restore weights and optimizer
75
  model.load_state_dict(checkpoint['model_state_dict'])
 
69
  optimizer = torch.optim.Adam(model.parameters(), lr=0.0001)
70
 
71
  # Load the checkpoint
72
+ BASE_DIR = os.path.dirname(os.path.abspath(__file__))
73
+ ckpt_path = os.path.join(BASE_DIR, "expression_model.t7")
74
+ checkpoint = torch.load(ckpt_path, map_location=device)
75
 
76
  # Restore weights and optimizer
77
  model.load_state_dict(checkpoint['model_state_dict'])