merve HF staff commited on
Commit
72a36cb
β€’
1 Parent(s): 9e9e5c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
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-tiny", filename="sam2_hiera_tiny.pt", local_dir = "./")
11
 
12
  DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
13
- CHECKPOINT = f"./sam2_hiera_tiny.pt"
14
- CONFIG = "sam2_hiera_t.yaml"
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
- ["./cats.png", "cat", 0.1],
 
 
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
  )