SamDaLamb commited on
Commit
c8227b7
·
verified ·
1 Parent(s): 3bdef3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -23,9 +23,12 @@ from io import BytesIO
23
  from models.common import DetectMultiBackend
24
 
25
 
 
26
  weights_path = "./last.pt"
27
- model = DetectMultiBackend(weights_path, device="cpu") # Loads the YOLOv5 model correctly
 
28
  model.eval()
 
29
  # model_path = "./last.pt"
30
  # model = torch.jit.load(model_path, map_location=torch.device("cpu"))
31
  # model.eval()
 
23
  from models.common import DetectMultiBackend
24
 
25
 
26
+
27
  weights_path = "./last.pt"
28
+ device = torch.device("cpu") # Correctly define the device
29
+ model = DetectMultiBackend(weights_path, device=device) # Load YOLOv5 model correctly
30
  model.eval()
31
+
32
  # model_path = "./last.pt"
33
  # model = torch.jit.load(model_path, map_location=torch.device("cpu"))
34
  # model.eval()