esun-choi commited on
Commit
4cfe9f7
ยท
1 Parent(s): a9ccd5e

Update seg.py

Browse files
Files changed (1) hide show
  1. seg.py +2 -1
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]]