Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,11 +7,11 @@ from sam2.build_sam import build_sam2
|
|
7 |
from sam2.sam2_image_predictor import SAM2ImagePredictor
|
8 |
import gradio as gr
|
9 |
|
10 |
-
hf_hub_download(repo_id = "merve/sam2-hiera-
|
11 |
|
12 |
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
13 |
-
CHECKPOINT = f"./
|
14 |
-
CONFIG = "
|
15 |
|
16 |
sam2_model = build_sam2(CONFIG, CHECKPOINT, device=DEVICE, apply_postprocessing=False)
|
17 |
predictor = SAM2ImagePredictor(sam2_model)
|
@@ -56,7 +56,9 @@ demo = gr.Interface(
|
|
56 |
title="OWLv2 π€ SAMv2",
|
57 |
description=description,
|
58 |
examples=[
|
59 |
-
["./
|
|
|
|
|
60 |
],
|
61 |
cache_examples=True
|
62 |
)
|
|
|
7 |
from sam2.sam2_image_predictor import SAM2ImagePredictor
|
8 |
import gradio as gr
|
9 |
|
10 |
+
hf_hub_download(repo_id = "merve/sam2-hiera-small", filename="sam2_hiera_small.pt", local_dir = "./")
|
11 |
|
12 |
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
13 |
+
CHECKPOINT = f"./sam2_hiera_small.pt"
|
14 |
+
CONFIG = "sam2_hiera_s.yaml"
|
15 |
|
16 |
sam2_model = build_sam2(CONFIG, CHECKPOINT, device=DEVICE, apply_postprocessing=False)
|
17 |
predictor = SAM2ImagePredictor(sam2_model)
|
|
|
56 |
title="OWLv2 π€ SAMv2",
|
57 |
description=description,
|
58 |
examples=[
|
59 |
+
["./bird.jpg", "bird", 0.15],
|
60 |
+
["./buddha.JPG", "buddha", 0.15],
|
61 |
+
|
62 |
],
|
63 |
cache_examples=True
|
64 |
)
|