faustoont commited on
Commit
5d000a5
·
1 Parent(s): cdbd6d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -8,7 +8,9 @@ import torch.nn as nn
8
  import cv2
9
  from albumentations.pytorch.transforms import ToTensorV2
10
 
11
- model = models.resnet50(pretrained=False)
 
 
12
  model.fc = nn.Linear(2048, 21)
13
  model.load_state_dict(torch.load('resnet_best.pth'), strict=True)#load weights from training run
14
  model.eval()
@@ -34,6 +36,4 @@ if uploaded_file is not None:
34
  elif ".csv" in uploaded_file.name: #csv check
35
  dataframe = pd.read_csv(uploaded_file)
36
  st.write(dataframe)
37
-
38
- #Load model torch.load.state_dict(PATH)
39
- torch.load.state_dict('resnet_best.pth')
 
8
  import cv2
9
  from albumentations.pytorch.transforms import ToTensorV2
10
 
11
+ #Load model torch.load.state_dict(PATH)
12
+ model = torch.load.state_dict('resnet_best.pth')
13
+ #model = models.resnet50(pretrained=False)
14
  model.fc = nn.Linear(2048, 21)
15
  model.load_state_dict(torch.load('resnet_best.pth'), strict=True)#load weights from training run
16
  model.eval()
 
36
  elif ".csv" in uploaded_file.name: #csv check
37
  dataframe = pd.read_csv(uploaded_file)
38
  st.write(dataframe)
39
+