Michael Rey commited on
Commit
9a18613
·
1 Parent(s): 6f49636

modified code

Browse files
Files changed (2) hide show
  1. src/resnet_model.py +1 -2
  2. src/streamlit_app.py +10 -10
src/resnet_model.py CHANGED
@@ -7,8 +7,7 @@ class MonkeyResNet(nn.Module):
7
  super(MonkeyResNet, self).__init__()
8
 
9
  # Load pretrained ResNet18 model from torchvision
10
- self.model = models.resnet18(pretrained=True) # pretrained weights from ImageNet
11
-
12
  # Replace the final fully connected layer to match number of classes
13
  in_features = self.model.fc.in_features
14
  self.model.fc = nn.Linear(in_features, num_classes)
 
7
  super(MonkeyResNet, self).__init__()
8
 
9
  # Load pretrained ResNet18 model from torchvision
10
+ self.model = models.resnet18(pretrained=False)
 
11
  # Replace the final fully connected layer to match number of classes
12
  in_features = self.model.fc.in_features
13
  self.model.fc = nn.Linear(in_features, num_classes)
src/streamlit_app.py CHANGED
@@ -18,16 +18,16 @@ st.set_page_config(page_title="ApexID: Monkey Species Classifier", layout="wide"
18
  MODEL_PATH = "monkey_resnet.pth"
19
  CLASS_NAMES = ['n0', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9']
20
  LABEL_MAP = {
21
- 'n0': 'alouatta_palliata',
22
- 'n1': 'erythrocebus_patas',
23
- 'n2': 'cacajao_calvus',
24
- 'n3': 'macaca_fuscata',
25
- 'n4': 'cebuella_pygmea',
26
- 'n5': 'cebus_capucinus',
27
- 'n6': 'mico_argentatus',
28
- 'n7': 'saimiri_sciureus',
29
- 'n8': 'aotus_nigriceps',
30
- 'n9': 'trachypithecus_johnii'
31
  }
32
 
33
  # Load model with caching to avoid reloading every time
 
18
  MODEL_PATH = "monkey_resnet.pth"
19
  CLASS_NAMES = ['n0', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9']
20
  LABEL_MAP = {
21
+ 'n0': 'Alouatta Palliata',
22
+ 'n1': 'Erythrocebus Patas',
23
+ 'n2': 'Cacajao Calvus',
24
+ 'n3': 'Macaca Fuscata',
25
+ 'n4': 'Cebuella Pygmea',
26
+ 'n5': 'Cebus Capucinus',
27
+ 'n6': 'Mico Argentatus',
28
+ 'n7': 'Saimiri Sciureus',
29
+ 'n8': 'Aotus Nigriceps',
30
+ 'n9': 'Trachypithecus Johnii'
31
  }
32
 
33
  # Load model with caching to avoid reloading every time