dhhd255 commited on
Commit
9811d4c
·
1 Parent(s): 3120f83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -6,7 +6,7 @@ from PIL import Image
6
 
7
  # Authenticate and download the custom model from Hugging Face Spaces
8
  fs = HfFileSystem()
9
- model_path = 'dhhd255/efficient_net_parkinsons/best_model.pth'
10
  with fs.open(model_path, 'rb') as f:
11
  model_content = f.read()
12
 
@@ -15,7 +15,7 @@ with open('best_model.pth', 'wb') as f:
15
  f.write(model_content)
16
 
17
  # Load your custom model onto the CPU
18
- model = torch.load('best_model.pth', map_location=torch.device('cpu'))
19
  model.eval()
20
 
21
  # Define a function that takes an image as input and uses the model for inference
 
6
 
7
  # Authenticate and download the custom model from Hugging Face Spaces
8
  fs = HfFileSystem()
9
+ model_path = 'dhhd255/main_model/best_model.pth'
10
  with fs.open(model_path, 'rb') as f:
11
  model_content = f.read()
12
 
 
15
  f.write(model_content)
16
 
17
  # Load your custom model onto the CPU
18
+ model = torch.hub.load('ultralytics/yolov5', 'custom', path='best_model.pth')
19
  model.eval()
20
 
21
  # Define a function that takes an image as input and uses the model for inference