Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,8 +3,6 @@ import gradio as gr
|
|
3 |
import cv2
|
4 |
import numpy as np
|
5 |
from collections import defaultdict
|
6 |
-
import os
|
7 |
-
import torch
|
8 |
|
9 |
# εε§ε樑ε
|
10 |
model = None
|
@@ -12,7 +10,7 @@ model = None
|
|
12 |
def load_model():
|
13 |
global model
|
14 |
if model is None:
|
15 |
-
model = YOLO('./yolo11x-seg.pt')
|
16 |
return model
|
17 |
|
18 |
def segment_image(image, conf_threshold, iou_threshold, mask_threshold, line_thickness, use_retina_masks):
|
@@ -165,4 +163,4 @@ def create_demo():
|
|
165 |
|
166 |
if __name__ == "__main__":
|
167 |
demo = create_demo()
|
168 |
-
demo.launch(
|
|
|
3 |
import cv2
|
4 |
import numpy as np
|
5 |
from collections import defaultdict
|
|
|
|
|
6 |
|
7 |
# εε§ε樑ε
|
8 |
model = None
|
|
|
10 |
def load_model():
|
11 |
global model
|
12 |
if model is None:
|
13 |
+
model = YOLO('./yolo11x-seg.pt')
|
14 |
return model
|
15 |
|
16 |
def segment_image(image, conf_threshold, iou_threshold, mask_threshold, line_thickness, use_retina_masks):
|
|
|
163 |
|
164 |
if __name__ == "__main__":
|
165 |
demo = create_demo()
|
166 |
+
demo.launch()
|