Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,14 @@
|
|
| 1 |
import cv2
|
| 2 |
import numpy as np
|
| 3 |
import gradio as gr
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
-
|
| 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²
|