Spaces:
Running
on
Zero
Running
on
Zero
pred
Browse files
app.py
CHANGED
@@ -83,11 +83,11 @@ def predict_masks(prompts):
|
|
83 |
|
84 |
DEVICE = torch.device("cuda")
|
85 |
SAM_MODEL = "facebook/sam2.1-hiera-large"
|
86 |
-
if PREDICTOR is None:
|
87 |
-
|
88 |
-
else:
|
89 |
-
|
90 |
-
|
91 |
|
92 |
"""Predict a single mask from the image based on selected points."""
|
93 |
image = np.array(prompts["image"]) # Convert the image to a numpy array
|
|
|
83 |
|
84 |
DEVICE = torch.device("cuda")
|
85 |
SAM_MODEL = "facebook/sam2.1-hiera-large"
|
86 |
+
# if PREDICTOR is None:
|
87 |
+
# PREDICTOR = SAM2ImagePredictor.from_pretrained(SAM_MODEL, device=DEVICE)
|
88 |
+
# else:
|
89 |
+
# PREDICTOR = PREDICTOR
|
90 |
+
PREDICTOR = SAM2ImagePredictor.from_pretrained(SAM_MODEL, device=DEVICE)
|
91 |
|
92 |
"""Predict a single mask from the image based on selected points."""
|
93 |
image = np.array(prompts["image"]) # Convert the image to a numpy array
|