Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,7 +10,13 @@ import os
|
|
10 |
|
11 |
# Load SAM and MiDaS models
|
12 |
def load_models():
|
|
|
|
|
13 |
sam_checkpoint = "sam_vit_b_01ec64.pth"
|
|
|
|
|
|
|
|
|
14 |
if not os.path.exists(sam_checkpoint):
|
15 |
raise FileNotFoundError("Please upload the SAM checkpoint file to the working directory.")
|
16 |
|
|
|
10 |
|
11 |
# Load SAM and MiDaS models
|
12 |
def load_models():
|
13 |
+
|
14 |
+
|
15 |
sam_checkpoint = "sam_vit_b_01ec64.pth"
|
16 |
+
model_type = "vit_b" # <-- Must match checkpoint
|
17 |
+
|
18 |
+
sam = sam_model_registry[model_type](checkpoint=sam_checkpoint).to(device)
|
19 |
+
|
20 |
if not os.path.exists(sam_checkpoint):
|
21 |
raise FileNotFoundError("Please upload the SAM checkpoint file to the working directory.")
|
22 |
|