Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ValidationError when using SAM #699

Open
KDeser opened this issue Dec 12, 2024 · 1 comment
Open

[BUG] ValidationError when using SAM #699

KDeser opened this issue Dec 12, 2024 · 1 comment
Labels
bug Something isn't working stale

Comments

@KDeser
Copy link

KDeser commented Dec 12, 2024

How should the input points be passed to SAM? Running the example code throws an error:

jsonschema.exceptions.ValidationError: '{}' is not of type 'array'

Reproduce by executing:

from rembg import remove, new_session
import numpy as np
from PIL import Image

rembg_session = new_session("sam")

input_image = Image.open(r"my_image.jpg)
input_points = np.array([[400, 350], [700, 400], [200, 400]])
input_labels = np.array([1, 1, 2])

result = remove(input_image , session=session, input_points=input_points, input_labels=input_labels)

It appears to be looking for a keyword argument named sam_prompt.

Using latest version on CPU, as a library.

@KDeser KDeser added the bug Something isn't working label Dec 12, 2024
Copy link

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant