muskangoyal06 commited on
Commit
e681295
·
verified ·
1 Parent(s): 2dd2d70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,10 +1,11 @@
1
  import gradio as gr
2
  import torch
3
  from ultralytics.nn.tasks import DetectionModel
4
- from torch.nn.modules.container import Sequential # Allow Sequential if needed
 
5
 
6
- # Whitelist the globals to bypass the pickle error (only do this if you trust the model source!)
7
- torch.serialization.add_safe_globals([DetectionModel, Sequential])
8
 
9
  from ultralyticsplus import YOLO
10
  from PIL import Image
 
1
  import gradio as gr
2
  import torch
3
  from ultralytics.nn.tasks import DetectionModel
4
+ from torch.nn.modules.container import Sequential
5
+ from ultralytics.nn.modules import Conv # Import Conv
6
 
7
+ # Whitelist the globals to bypass the pickle errors (only do this if you trust the model source!)
8
+ torch.serialization.add_safe_globals([DetectionModel, Sequential, Conv])
9
 
10
  from ultralyticsplus import YOLO
11
  from PIL import Image