-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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] '{}' is not of type 'array' when using sam model. #569
Comments
Hi, Gao. Have you solved this problem yet? I think I have the same problem with you. |
not solved |
Does anyone know why this is happening? |
I have the same problem. Have you solved it? |
This is a character escaping issue. If you are running this from the cmd prompt, it should look like this:
If you're running from PowerShell 5.1, it should look like this: rembg i -m sam -x '{ \"sam_prompt\": [{\"type\": \"point\", \"data\": [724, 740], \"label\": 1}] }' .\1305696_1704870215425_1705054411.png xxx.png If you're running from PowerShell 7.4, it should look like this: rembg i -m sam -x '{ "sam_prompt": [{"type": "point", "data": [724, 740], "label": 1}] }' .\1305696_1704870215425_1705054411.png xxx.png |
I got the same error on the HTTP server. How to solve this when using it interactively on the HTTP server? |
The error reporting location should be located in |
Hello, is anybody help me "how to to use SAM model with library usage". I am trying to handle as following code line but I am getting error.
Error
|
Hello,
|
This issue is stale because it has been open for 30 days with no activity. |
jsonschema.exceptions.ValidationError: '{}' is not of type 'array' Failed validating 'type' in schema: On instance: 这里的 prompt={} 应该改为一个数组from rembg import remove prompt = [{'type': 'label', 'data': [0.5, 0.5], 'label': 1}] |
Did you find a solution? I am unable to run "sam" in a python file as well? Like the library approach also failed @kerberosargos @aloeb-gh |
I am getting the same issue, but I feel prompt is not the problem here :
reproduces the same error |
This issue is stale because it has been open for 30 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
@Suvoo You are getting that error because sam_prompt is a mandatory field. Try passing the input_labels and data as follows, should work. input = Image.open(input_path)
output = remove(input,
session=new_session("sam"),
sam_prompt=[{"type": "point", "data": [10, 10], "label": 0}])
output.save(output_path) |
Describe the bug
Unable to use the "sam" model in cli.
rembg i -m sam -x '{ "sam_prompt": [{"type": "point", "data": [724, 740], "label": 1}] }' .\1305696_1704870215425_1705054411.png xxx.png
Getting error: '{}' is not of type 'array'
To Reproduce
rembg i -m sam -x '{ "sam_prompt": [{"type": "point", "data": [724, 740], "label": 1}] }' .\1305696_1704870215425_1705054411.png xxx.png
OS Version:
window 11
Rembg version:
v2.0.53
The text was updated successfully, but these errors were encountered: