Spaces:
Runtime error
Runtime error
Tobias Cornille
commited on
Commit
•
d334f4b
1
Parent(s):
edfcc3f
Fix device
Browse files
app.py
CHANGED
@@ -363,7 +363,8 @@ ckpt_repo_id = "ShilongLiu/GroundingDINO"
|
|
363 |
ckpt_filename = "groundingdino_swint_ogc.pth"
|
364 |
sam_checkpoint = "./sam_vit_h_4b8939.pth"
|
365 |
|
366 |
-
device =
|
|
|
367 |
|
368 |
# initialize groundingdino model
|
369 |
dino_model = load_model_hf(config_file, ckpt_repo_id, ckpt_filename, device)
|
|
|
363 |
ckpt_filename = "groundingdino_swint_ogc.pth"
|
364 |
sam_checkpoint = "./sam_vit_h_4b8939.pth"
|
365 |
|
366 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
367 |
+
print("Using device:", device)
|
368 |
|
369 |
# initialize groundingdino model
|
370 |
dino_model = load_model_hf(config_file, ckpt_repo_id, ckpt_filename, device)
|