Skip to content

Commit

Permalink
update default sam_prompt structure to include point data
Browse files Browse the repository at this point in the history
Signed-off-by: ふぁ <[email protected]>
  • Loading branch information
fa0311 committed Nov 29, 2024
1 parent 00ad95d commit 9e6c461
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rembg/sessions/sam.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,16 @@ def predict(
Returns:
List[PILImage]: A list of masks generated by the decoder.
"""
prompt = kwargs.get("sam_prompt", "{}")
prompt = kwargs.get(
"sam_prompt",
[
{
"type": "point",
"label": 1,
"data": [int(img.width / 2), int(img.height / 2)],
}
],
)
schema = {
"type": "array",
"items": {
Expand Down

0 comments on commit 9e6c461

Please sign in to comment.