yunusajib commited on
Commit
5f2ef5e
·
verified ·
1 Parent(s): e754390

update app

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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 the necessary class to the safe globals list
9
- torch.serialization.add_safe_globals([DetectionModel])
 
 
 
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")