LPX55 commited on
Commit
fd14388
·
1 Parent(s): eacd5d0
Files changed (1) hide show
  1. app.py +5 -5
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
- PREDICTOR = SAM2ImagePredictor.from_pretrained(SAM_MODEL, device=DEVICE)
88
- else:
89
- PREDICTOR = PREDICTOR
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