fix: process other models than sam when using enhance

This commit is contained in:
Manuel Schmid
2024-06-16 21:05:10 +02:00
parent ff3418876d
commit 9c93c18d0b
3 changed files with 12 additions and 8 deletions
+1 -3
View File
@@ -56,7 +56,7 @@ def generate_mask_from_image(image: np.ndarray, mask_model: str = 'sam', extras=
if 'image' in image:
image = image['image']
if mask_model != 'sam' and sam_options is None:
if mask_model != 'sam' or sam_options is None:
result = remove(
image,
session=new_session(mask_model, **extras),
@@ -66,8 +66,6 @@ def generate_mask_from_image(image: np.ndarray, mask_model: str = 'sam', extras=
return result, dino_detection_count, sam_detection_count, sam_detection_on_mask_count
assert sam_options is not None
detections, boxes, logits, phrases = default_groundingdino(
image=image,
caption=sam_options.dino_prompt,