vmoras commited on
Commit
b83e9d8
1 Parent(s): 183919f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -16,7 +16,7 @@ def set_predictor(image):
16
  """
17
  Creates a Sam predictor object based on a given image and model.
18
  """
19
- device = 'cpu'
20
  sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
21
  sam.to(device=device)
22
 
 
16
  """
17
  Creates a Sam predictor object based on a given image and model.
18
  """
19
+ device = 'cuda' if torch.cuda.is_available() else 'cpu'
20
  sam = sam_model_registry[model_type](checkpoint=sam_checkpoint)
21
  sam.to(device=device)
22