sparsh007 commited on
Commit
23bb58e
·
verified ·
1 Parent(s): 3fadaf8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,9 +9,9 @@ import shutil
9
  # Clear the torch hub cache to prevent any previous corrupted downloads
10
  shutil.rmtree(torch.hub._get_torch_home(), ignore_errors=True)
11
 
12
- # Load the YOLOv5 model (ensure the path is correct)
13
  model = torch.hub.load(
14
- 'ultralytics/yolov5', 'custom', path='yolov5/runs/train/exp/weights/best.pt', trust_repo=True
15
  )
16
 
17
  # Global variables to store images and labels for carousel functionality
 
9
  # Clear the torch hub cache to prevent any previous corrupted downloads
10
  shutil.rmtree(torch.hub._get_torch_home(), ignore_errors=True)
11
 
12
+ # Load the YOLOv5 model from the uploaded best.pt file
13
  model = torch.hub.load(
14
+ 'ultralytics/yolov5', 'custom', path='best.pt', trust_repo=True
15
  )
16
 
17
  # Global variables to store images and labels for carousel functionality