Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,9 +20,15 @@ import matplotlib.pyplot as plt
|
|
20 |
from io import BytesIO
|
21 |
|
22 |
# Load the YOLO model
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
25 |
model.eval()
|
|
|
|
|
|
|
26 |
|
27 |
transform = transforms.Compose([
|
28 |
transforms.Resize((640, 640)),
|
|
|
20 |
from io import BytesIO
|
21 |
|
22 |
# Load the YOLO model
|
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()
|
32 |
|
33 |
transform = transforms.Compose([
|
34 |
transforms.Resize((640, 640)),
|