Spaces:
Sleeping
Sleeping
Update detector.py
Browse files- detector.py +1 -1
detector.py
CHANGED
@@ -6,7 +6,7 @@ import torch.serialization
|
|
6 |
class LBWDetector:
|
7 |
def __init__(self, model_path='best.pt'):
|
8 |
"""Initialize YOLO model with safe globals for PyTorch 2.6+."""
|
9 |
-
with torch.serialization.safe_globals([torch.nn.modules.container.Sequential]):
|
10 |
self.model = YOLO(model_path)
|
11 |
|
12 |
def detect_objects(self, frame):
|
|
|
6 |
class LBWDetector:
|
7 |
def __init__(self, model_path='best.pt'):
|
8 |
"""Initialize YOLO model with safe globals for PyTorch 2.6+."""
|
9 |
+
with torch.serialization.safe_globals([torch.nn.modules.container.Sequential, ultralytics.nn.tasks.DetectionModel]):
|
10 |
self.model = YOLO(model_path)
|
11 |
|
12 |
def detect_objects(self, frame):
|