Spaces:
Runtime error
Runtime error
update app
Browse files
app.py
CHANGED
@@ -5,8 +5,11 @@ import gradio as gr
|
|
5 |
from ultralytics import YOLO
|
6 |
from ultralytics.nn.tasks import DetectionModel
|
7 |
|
8 |
-
# Add
|
9 |
-
torch.serialization.add_safe_globals([
|
|
|
|
|
|
|
10 |
|
11 |
# Load the YOLO model
|
12 |
model = YOLO("yolov8n.pt")
|
|
|
5 |
from ultralytics import YOLO
|
6 |
from ultralytics.nn.tasks import DetectionModel
|
7 |
|
8 |
+
# Add both necessary classes to the safe globals list
|
9 |
+
torch.serialization.add_safe_globals([
|
10 |
+
DetectionModel,
|
11 |
+
torch.nn.modules.container.Sequential
|
12 |
+
])
|
13 |
|
14 |
# Load the YOLO model
|
15 |
model = YOLO("yolov8n.pt")
|