Update app.py
Browse files
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 |
|