yansong1616 commited on
Commit
e4d53e2
·
verified ·
1 Parent(s): fbb1647

Update SAM2/sam2/build_sam.py

Browse files
Files changed (1) hide show
  1. SAM2/sam2/build_sam.py +1 -1
SAM2/sam2/build_sam.py CHANGED
@@ -43,7 +43,7 @@ def build_sam2(
43
  def build_sam2_video_predictor(
44
  config_file,
45
  ckpt_path=None,
46
- device="cuda",
47
  mode="eval",
48
  hydra_overrides_extra=[],
49
  apply_postprocessing=True,
 
43
  def build_sam2_video_predictor(
44
  config_file,
45
  ckpt_path=None,
46
+ device="cuda" if torch.cuda.is_available() else "cpu",
47
  mode="eval",
48
  hydra_overrides_extra=[],
49
  apply_postprocessing=True,