Spaces:
Sleeping
Sleeping
Update seg.py
Browse files
seg.py
CHANGED
@@ -6,7 +6,8 @@ import cv2
|
|
6 |
|
7 |
# ์๋๋ unet์ด๊ณ dinov2 ์ ์ ์คํํ๋ ๋ชจ๋ธ์
๋๋ค.
|
8 |
def segmentation(img):
|
9 |
-
device=torch.device("cuda")
|
|
|
10 |
net=torch.load("weights/unet.pth")
|
11 |
|
12 |
mask_values=[[0, 0, 0], [255, 255, 255]]
|
|
|
6 |
|
7 |
# ์๋๋ unet์ด๊ณ dinov2 ์ ์ ์คํํ๋ ๋ชจ๋ธ์
๋๋ค.
|
8 |
def segmentation(img):
|
9 |
+
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
10 |
+
#device=torch.device("cuda")
|
11 |
net=torch.load("weights/unet.pth")
|
12 |
|
13 |
mask_values=[[0, 0, 0], [255, 255, 255]]
|