Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,14 +1,19 @@
|
|
| 1 |
import cv2
|
| 2 |
import numpy as np
|
| 3 |
import gradio as gr
|
|
|
|
|
|
|
| 4 |
import torch.serialization
|
| 5 |
-
|
|
|
|
| 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²
|
|
|
|
| 1 |
import cv2
|
| 2 |
import numpy as np
|
| 3 |
import gradio as gr
|
| 4 |
+
|
| 5 |
+
import torch
|
| 6 |
import torch.serialization
|
| 7 |
+
import ultralytics.nn.tasks as tasks
|
| 8 |
+
torch.serialization.add_safe_globals({tasks.DetectionModel})
|
| 9 |
|
| 10 |
from ultralyticsplus import YOLO
|
| 11 |
+
|
| 12 |
model = YOLO("keremberke/yolov8n-pothole-segmentation")
|
| 13 |
model.overrides['conf'] = 0.25
|
| 14 |
|
| 15 |
|
| 16 |
+
|
| 17 |
# Constants
|
| 18 |
SCALE = 0.005 # m² per pixel²
|
| 19 |
COST_PER_M2 = 1000 # ₹ per m²
|