akhaliq HF Staff commited on
Commit
75921b2
·
verified ·
1 Parent(s): bc0d93c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  import torch
3
  import numpy as np
@@ -37,6 +38,7 @@ def overlay_masks(image: Image.Image, masks: torch.Tensor) -> Image.Image:
37
  image = Image.alpha_composite(image, overlay)
38
  return image
39
 
 
40
  def segment(image: Image.Image, text: str, threshold: float, mask_threshold: float):
41
  """
42
  Perform promptable concept segmentation using SAM3.
 
1
+ import spaces
2
  import gradio as gr
3
  import torch
4
  import numpy as np
 
38
  image = Image.alpha_composite(image, overlay)
39
  return image
40
 
41
+ spaces.GPU()
42
  def segment(image: Image.Image, text: str, threshold: float, mask_threshold: float):
43
  """
44
  Perform promptable concept segmentation using SAM3.