Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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.
|