mahmoud669 commited on
Commit
0a3c48d
·
verified ·
1 Parent(s): 01fe917

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -121,6 +121,10 @@ with right_column:
121
  extract(uploaded_file, 'forget_set')
122
  st.write("Unlearning begins...")
123
  unlearn()
 
 
 
 
124
  uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
125
  # Perform inference
126
  st.write("Performing inference...")
@@ -137,7 +141,7 @@ with right_column:
137
  preds = []
138
  with torch.no_grad():
139
  for i in range(50):
140
- output = model(image_tensor)
141
  probabilities = F.softmax(output, dim=1)
142
  pred_class = torch.argmax(probabilities, dim=1)
143
  pred_label = reversed_map[pred_class.item()]
 
121
  extract(uploaded_file, 'forget_set')
122
  st.write("Unlearning begins...")
123
  unlearn()
124
+ model_s = timm.create_model("rexnet_150", pretrained = True, num_classes = 17)
125
+ model_s.load_state_dict(torch.load('celeb-model-unlearned.pth', map_location=torch.device('cpu')))
126
+ model_s.eval()
127
+
128
  uploaded_file = st.file_uploader("Choose an image...", type=["jpg", "jpeg", "png"])
129
  # Perform inference
130
  st.write("Performing inference...")
 
141
  preds = []
142
  with torch.no_grad():
143
  for i in range(50):
144
+ output = model_s(image_tensor)
145
  probabilities = F.softmax(output, dim=1)
146
  pred_class = torch.argmax(probabilities, dim=1)
147
  pred_label = reversed_map[pred_class.item()]