Spaces:
Running
on
Zero
Running
on
Zero
jadechoghari
commited on
Commit
•
db79c47
1
Parent(s):
7788a89
Update app.py
Browse files
app.py
CHANGED
@@ -37,8 +37,8 @@ device = "cuda" if torch.cuda.is_available() else "cpu"
|
|
37 |
# we initialize model and processor
|
38 |
checkpoint = "google/owlv2-base-patch16-ensemble"
|
39 |
detector = pipeline(model=checkpoint, task="zero-shot-object-detection", device=device)
|
40 |
-
sam_model = SamModel.from_pretrained("jadechoghari/robustsam-vit-
|
41 |
-
sam_processor = SamProcessor.from_pretrained("jadechoghari/robustsam-vit-
|
42 |
|
43 |
def apply_mask(image, mask, color):
|
44 |
"""Apply a mask to an image with a specific color."""
|
|
|
37 |
# we initialize model and processor
|
38 |
checkpoint = "google/owlv2-base-patch16-ensemble"
|
39 |
detector = pipeline(model=checkpoint, task="zero-shot-object-detection", device=device)
|
40 |
+
sam_model = SamModel.from_pretrained("jadechoghari/robustsam-vit-huge").to(device)
|
41 |
+
sam_processor = SamProcessor.from_pretrained("jadechoghari/robustsam-vit-huge")
|
42 |
|
43 |
def apply_mask(image, mask, color):
|
44 |
"""Apply a mask to an image with a specific color."""
|