mrtlive commited on
Commit
0930265
·
1 Parent(s): 3c03ccd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -12,11 +12,10 @@ from segment_anything import SamAutomaticMaskGenerator, SamPredictor, sam_model_
12
 
13
  matplotlib.pyplot.switch_backend('Agg') # for matplotlib to work in gradio
14
 
15
- device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # use GPU if available
16
 
17
  #setup model
18
  sam_checkpoint = "sam_vit_h_4b8939.pth"
19
- device = "cuda"
20
  model_type = "default"
21
  sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
22
  sam.to(device=device)
 
12
 
13
  matplotlib.pyplot.switch_backend('Agg') # for matplotlib to work in gradio
14
 
 
15
 
16
  #setup model
17
  sam_checkpoint = "sam_vit_h_4b8939.pth"
18
+ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') # use GPU if available
19
  model_type = "default"
20
  sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
21
  sam.to(device=device)