Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import torch
|
|
| 3 |
from torchvision import datasets, models, transforms
|
| 4 |
from PIL import Image
|
| 5 |
|
| 6 |
-
LABELS = ['
|
| 7 |
|
| 8 |
model = models.resnet18(pretrained=True)
|
| 9 |
num_ftrs = model.fc.in_features
|
|
@@ -11,7 +11,7 @@ num_ftrs = model.fc.in_features
|
|
| 11 |
model.fc = torch.nn.Linear(num_ftrs, 2)
|
| 12 |
|
| 13 |
state_dict = torch.load('up500Model.pt', map_location='cpu')
|
| 14 |
-
model.load_state_dict(state_dict
|
| 15 |
model.eval()
|
| 16 |
|
| 17 |
imgTransforms = transforms.Compose([
|
|
|
|
| 3 |
from torchvision import datasets, models, transforms
|
| 4 |
from PIL import Image
|
| 5 |
|
| 6 |
+
LABELS = ['Fiat 500', 'VW Up!']
|
| 7 |
|
| 8 |
model = models.resnet18(pretrained=True)
|
| 9 |
num_ftrs = model.fc.in_features
|
|
|
|
| 11 |
model.fc = torch.nn.Linear(num_ftrs, 2)
|
| 12 |
|
| 13 |
state_dict = torch.load('up500Model.pt', map_location='cpu')
|
| 14 |
+
model.load_state_dict(state_dict)
|
| 15 |
model.eval()
|
| 16 |
|
| 17 |
imgTransforms = transforms.Compose([
|