sanchitnanda03 commited on
Commit
3eb1370
·
verified ·
1 Parent(s): d08173c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -1,12 +1,14 @@
1
  import cv2
2
  import numpy as np
3
  import gradio as gr
4
- from ultralyticsplus import YOLO
 
5
 
6
- # Load YOLO model
7
  model = YOLO("keremberke/yolov8n-pothole-segmentation")
8
  model.overrides['conf'] = 0.25
9
 
 
10
  # Constants
11
  SCALE = 0.005 # m² per pixel²
12
  COST_PER_M2 = 1000 # ₹ per m²
 
1
  import cv2
2
  import numpy as np
3
  import gradio as gr
4
+ import torch.serialization
5
+ torch.serialization.add_safe_globals(['ultralytics.nn.tasks.DetectionModel'])
6
 
7
+ from ultralyticsplus import YOLO
8
  model = YOLO("keremberke/yolov8n-pothole-segmentation")
9
  model.overrides['conf'] = 0.25
10
 
11
+
12
  # Constants
13
  SCALE = 0.005 # m² per pixel²
14
  COST_PER_M2 = 1000 # ₹ per m²