luxmorocco commited on
Commit
615de6b
1 Parent(s): 98fadef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -15
app.py CHANGED
@@ -208,21 +208,9 @@ uploaded_file = st.sidebar.file_uploader("Upload Chest X-ray image", type=["png"
208
  # Load the model (use your model loading function)
209
  # Ensure the model path is correct and accessible
210
 
211
- #model = create_model(num_classes=15)
212
- #model.load_state_dict(torch.load('Doctoria CXR Thoraric Full Model.pth', map_location=torch.device('cpu')))
213
- #model.eval()
214
-
215
- def load_model(model_path):
216
- # Create an instance of the VinDetector model
217
- model = VinDetector(num_classes=14) # Adjust num_classes as needed
218
-
219
- # Load the saved state_dict
220
- model.load_state_dict(torch.load(model_path, map_location=torch.device('cpu')))
221
-
222
- model.eval() # Set the model to evaluation mode
223
- return model
224
-
225
- model = load_model('Doctoria CXR Thoraric Full Model.pth')
226
 
227
  def process_image(image_path):
228
  # Load and transform the image
 
208
  # Load the model (use your model loading function)
209
  # Ensure the model path is correct and accessible
210
 
211
+ model = create_model(num_classes=15)
212
+ model.load_state_dict(torch.load('Doctoria CXR Thoraric Full Model.pth', map_location=torch.device('cpu')))
213
+ model.eval()
 
 
 
 
 
 
 
 
 
 
 
 
214
 
215
  def process_image(image_path):
216
  # Load and transform the image