Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -86,7 +86,8 @@ def initialize_models(sam_path, adapter_pth, model_cfg, cfg):
|
|
86 |
global sam2_model, clip_model, mask_adapter
|
87 |
|
88 |
if sam2_model is None:
|
89 |
-
sam2_model = build_sam2(model_cfg, sam_path, device="
|
|
|
90 |
print("SAM2 model initialized.")
|
91 |
|
92 |
if clip_model is None:
|
|
|
86 |
global sam2_model, clip_model, mask_adapter
|
87 |
|
88 |
if sam2_model is None:
|
89 |
+
sam2_model = build_sam2(model_cfg, sam_path, device="cpu", apply_postprocessing=False)
|
90 |
+
sam2_model = sam2_model.to("cuda")
|
91 |
print("SAM2 model initialized.")
|
92 |
|
93 |
if clip_model is None:
|