Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -29,7 +29,7 @@ def load_mask_generator() -> SamAutomaticMaskGenerator:
|
|
| 29 |
checkpoint = os.path.join(CHECKPOINT_PATH, CHECKPOINT_NAME)
|
| 30 |
if not os.path.exists(checkpoint):
|
| 31 |
urllib.request.urlretrieve(CHECKPOINT_URL, checkpoint)
|
| 32 |
-
sam = sam_model_registry[MODEL_TYPE](checkpoint=
|
| 33 |
mask_generator = SamAutomaticMaskGenerator(sam)
|
| 34 |
return mask_generator
|
| 35 |
|
|
|
|
| 29 |
checkpoint = os.path.join(CHECKPOINT_PATH, CHECKPOINT_NAME)
|
| 30 |
if not os.path.exists(checkpoint):
|
| 31 |
urllib.request.urlretrieve(CHECKPOINT_URL, checkpoint)
|
| 32 |
+
sam = sam_model_registry[MODEL_TYPE](checkpoint=checkpoint).to(device)
|
| 33 |
mask_generator = SamAutomaticMaskGenerator(sam)
|
| 34 |
return mask_generator
|
| 35 |
|