Update app.py
Browse files
app.py
CHANGED
@@ -250,7 +250,7 @@ class GradioWindow():
|
|
250 |
self.concatenated_masks = res
|
251 |
return res, current_object, True
|
252 |
|
253 |
-
|
254 |
def detect(self, image: Image, prompt: str, is_segmmask: bool,
|
255 |
box_threshold: float, text_threshold: float):
|
256 |
detections = self.grounding_dino_model.predict_with_classes(
|
@@ -321,7 +321,7 @@ class GradioWindow():
|
|
321 |
image = cv2.addWeighted(image, 0.7, mask, 0.3, 0)
|
322 |
return image
|
323 |
|
324 |
-
|
325 |
def segment(self, sam_predictor: SamPredictor, image: np.ndarray, xyxy: np.ndarray) -> np.ndarray:
|
326 |
sam_predictor.set_image(image)
|
327 |
result_masks = []
|
@@ -334,7 +334,7 @@ class GradioWindow():
|
|
334 |
result_masks.append(masks[index])
|
335 |
return np.array(result_masks)
|
336 |
|
337 |
-
|
338 |
def augment_image(self, image: Image,
|
339 |
current_object: str, new_objects_list: str,
|
340 |
ddim_steps: int, guidance_scale: int, seed: int, return_prompt: str) -> tuple:
|
|
|
250 |
self.concatenated_masks = res
|
251 |
return res, current_object, True
|
252 |
|
253 |
+
|
254 |
def detect(self, image: Image, prompt: str, is_segmmask: bool,
|
255 |
box_threshold: float, text_threshold: float):
|
256 |
detections = self.grounding_dino_model.predict_with_classes(
|
|
|
321 |
image = cv2.addWeighted(image, 0.7, mask, 0.3, 0)
|
322 |
return image
|
323 |
|
324 |
+
|
325 |
def segment(self, sam_predictor: SamPredictor, image: np.ndarray, xyxy: np.ndarray) -> np.ndarray:
|
326 |
sam_predictor.set_image(image)
|
327 |
result_masks = []
|
|
|
334 |
result_masks.append(masks[index])
|
335 |
return np.array(result_masks)
|
336 |
|
337 |
+
|
338 |
def augment_image(self, image: Image,
|
339 |
current_object: str, new_objects_list: str,
|
340 |
ddim_steps: int, guidance_scale: int, seed: int, return_prompt: str) -> tuple:
|