Update app.py
Browse files
app.py
CHANGED
@@ -59,23 +59,23 @@ orientation_labels = {
|
|
59 |
|
60 |
model_race = RaceClassifier(n_classes=4)
|
61 |
model_race.to(device)
|
62 |
-
model_race.load_state_dict(torch.load('
|
63 |
|
64 |
model_age = RaceClassifier(n_classes=3)
|
65 |
model_age.to(device)
|
66 |
-
model_age.load_state_dict(torch.load('
|
67 |
|
68 |
model_education = RaceClassifier(n_classes=2)
|
69 |
model_education.to(device)
|
70 |
-
model_education.load_state_dict(torch.load('
|
71 |
|
72 |
model_gender = RaceClassifier(n_classes=4)
|
73 |
model_gender.to(device)
|
74 |
-
model_gender.load_state_dict(torch.load('
|
75 |
|
76 |
model_orientation = RaceClassifier(n_classes=2)
|
77 |
model_orientation.to(device)
|
78 |
-
model_orientation.load_state_dict(torch.load('
|
79 |
|
80 |
|
81 |
def evaluate(model, input, mask):
|
|
|
59 |
|
60 |
model_race = RaceClassifier(n_classes=4)
|
61 |
model_race.to(device)
|
62 |
+
model_race.load_state_dict(torch.load('best_model_race.pt', map_location=torch.device('cpu')))
|
63 |
|
64 |
model_age = RaceClassifier(n_classes=3)
|
65 |
model_age.to(device)
|
66 |
+
model_age.load_state_dict(torch.load('best_model_age.pt', map_location=torch.device('cpu')))
|
67 |
|
68 |
model_education = RaceClassifier(n_classes=2)
|
69 |
model_education.to(device)
|
70 |
+
model_education.load_state_dict(torch.load('best_model_education.pt', map_location=torch.device('cpu')))
|
71 |
|
72 |
model_gender = RaceClassifier(n_classes=4)
|
73 |
model_gender.to(device)
|
74 |
+
model_gender.load_state_dict(torch.load('best_model_gender.pt', map_location=torch.device('cpu')))
|
75 |
|
76 |
model_orientation = RaceClassifier(n_classes=2)
|
77 |
model_orientation.to(device)
|
78 |
+
model_orientation.load_state_dict(torch.load('best_model_orientation.pt', map_location=torch.device('cpu')))
|
79 |
|
80 |
|
81 |
def evaluate(model, input, mask):
|