Spaces:
Running
on
Zero
Running
on
Zero
hm
Browse files- sam2_mask.py +2 -0
sam2_mask.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
import os
|
3 |
os.environ["TORCH_CUDNN_SDPA_ENABLED"] = "1"
|
@@ -106,6 +107,7 @@ def show_masks(image, masks, scores, point_coords=None, box_coords=None, input_l
|
|
106 |
plt.close() # Close the figure to free up memory
|
107 |
return combined_images, mask_images
|
108 |
|
|
|
109 |
def sam_process(input_image, tracking_points, trackings_input_label):
|
110 |
image = Image.open(input_image)
|
111 |
image = np.array(image.convert("RGB"))
|
|
|
1 |
+
import spaces
|
2 |
import gradio as gr
|
3 |
import os
|
4 |
os.environ["TORCH_CUDNN_SDPA_ENABLED"] = "1"
|
|
|
107 |
plt.close() # Close the figure to free up memory
|
108 |
return combined_images, mask_images
|
109 |
|
110 |
+
@spaces.GPU()
|
111 |
def sam_process(input_image, tracking_points, trackings_input_label):
|
112 |
image = Image.open(input_image)
|
113 |
image = np.array(image.convert("RGB"))
|