junaidshafique commited on
Commit
77717c2
·
verified ·
1 Parent(s): 222802b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -6,12 +6,12 @@ import torchvision.models as models
6
 
7
  # Load model
8
  model = models.resnet18()
9
- model.fc = torch.nn.Linear(model.fc.in_features, 3) # Change '3' to the number of your classes
10
  model.load_state_dict(torch.load("animal_classifier.pth", map_location=torch.device('cpu')))
11
  model.eval()
12
 
13
  # Class labels (update as needed)
14
- class_labels = ["cat", "dog", "horse"] # <-- Replace with your real class names
15
 
16
  # Transform
17
  transform = transforms.Compose([
 
6
 
7
  # Load model
8
  model = models.resnet18()
9
+ model.fc = torch.nn.Linear(model.fc.in_features, 13) # Change '3' to the number of your classes
10
  model.load_state_dict(torch.load("animal_classifier.pth", map_location=torch.device('cpu')))
11
  model.eval()
12
 
13
  # Class labels (update as needed)
14
+ class_labels = ["antelope", "badger", "bat", "bear", "bee", "beetle","jellyfish","kangaroo","koala", "ladybug","leopard","lion","lizard"] # <-- Replace with your real class names
15
 
16
  # Transform
17
  transform = transforms.Compose([