Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -43,7 +43,7 @@ dog_breeds = ["Afghan_Hound", "African_Hunting_Dog", "Airedale", "American_Staff
|
|
43 |
"Miniature_Poodle", "Miniature_Schnauzer", "Otterhound", "Papillon", "Pug", "Redbone",
|
44 |
"Schipperke", "Silky_Terrier", "Soft-Coated_Wheaten_Terrier", "Standard_Poodle",
|
45 |
"Standard_Schnauzer", "Toy_Poodle", "Toy_Terrier", "Vizsla", "Whippet",
|
46 |
-
"Wire-Haired_Fox_Terrier"]
|
47 |
|
48 |
class MultiHeadAttention(nn.Module):
|
49 |
|
@@ -100,11 +100,11 @@ class BaseModel(nn.Module):
|
|
100 |
return logits, attended_features
|
101 |
|
102 |
|
103 |
-
num_classes =
|
104 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
105 |
model = BaseModel(num_classes=num_classes, device=device)
|
106 |
|
107 |
-
checkpoint = torch.load('
|
108 |
model.load_state_dict(checkpoint['model_state_dict'])
|
109 |
|
110 |
# evaluation mode
|
|
|
43 |
"Miniature_Poodle", "Miniature_Schnauzer", "Otterhound", "Papillon", "Pug", "Redbone",
|
44 |
"Schipperke", "Silky_Terrier", "Soft-Coated_Wheaten_Terrier", "Standard_Poodle",
|
45 |
"Standard_Schnauzer", "Toy_Poodle", "Toy_Terrier", "Vizsla", "Whippet",
|
46 |
+
"Wire-Haired_Fox_Terrier","Havanese", "Dachshund", "Shiba_Inu", "Bichon_Frise"]
|
47 |
|
48 |
class MultiHeadAttention(nn.Module):
|
49 |
|
|
|
100 |
return logits, attended_features
|
101 |
|
102 |
|
103 |
+
num_classes = 124
|
104 |
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
105 |
model = BaseModel(num_classes=num_classes, device=device)
|
106 |
|
107 |
+
checkpoint = torch.load('[124_82.30]_best_model_dog.pth', map_location=torch.device('cpu'))
|
108 |
model.load_state_dict(checkpoint['model_state_dict'])
|
109 |
|
110 |
# evaluation mode
|