Skip to content

Commit

Permalink
fix (text to segment): visualization option
Browse files Browse the repository at this point in the history
  • Loading branch information
mvoodarla committed Sep 2, 2024
1 parent e1bcfc5 commit 7671385
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions text_to_segment/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ def get_object_bbox(image: sieve.File, object_name: str):
],
metadata=metadata
)
def segment(file: sieve.File, object_name: str):
def segment(file: sieve.File, object_name: str, return_mp4: bool = False):
"""
:param file: photo or video to segment
:param object_name: the object you wish to segment
:param return_mp4: if True, return only an MP4 video of the segmentation masks
"""
sam = sieve.function.get("sieve/sam2")

Expand All @@ -90,7 +91,7 @@ def segment(file: sieve.File, object_name: str):
file=file,
prompts=[sam_prompt],
model_type="tiny",
debug_masks=False
debug_masks=return_mp4
)

return sam_out
Expand Down

0 comments on commit 7671385

Please sign in to comment.