Giter Site home page Giter Site logo

Comments (11)

zhengxiongli08 avatar zhengxiongli08 commented on September 26, 2024

Hi, Gao. Have you solved this problem yet? I think I have the same problem with you.

from rembg.

ShylockGao avatar ShylockGao commented on September 26, 2024

Hi, Gao. Have you solved this problem yet? I think I have the same problem with you.

not solved

from rembg.

AbakirH avatar AbakirH commented on September 26, 2024

Does anyone know why this is happening?

from rembg.

Loewen-Hob avatar Loewen-Hob commented on September 26, 2024

I have the same problem. Have you solved it?

from rembg.

jalsop24 avatar jalsop24 commented on September 26, 2024

I think it stems from the default being wrong here -

prompt = kwargs.get("sam_prompt", "{}")

This is also relevant to #577

from rembg.

ImportTaste avatar ImportTaste commented on September 26, 2024

This is a character escaping issue. If you are running this from the cmd prompt, 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 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

from rembg.

yuxi-liu-wired avatar yuxi-liu-wired commented on September 26, 2024

I got the same error on the HTTP server.

How to solve this when using it interactively on the HTTP server?

from rembg.

hanqingL-bjtu avatar hanqingL-bjtu commented on September 26, 2024

The error reporting location should be located in
Link Text
It means there is a problem with the json format input of your prompt.

from rembg.

kerberosargos avatar kerberosargos commented on September 26, 2024

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.

bg_cleaned_image = remove(data=my_image, session=rembg.new_session("sam", sam_prompt=[{"type": "point", "data": [724, 740], "label": 1}])

Error

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

Failed validating 'type' in schema:
                                       'type': 'array'},
                              'type': {'type': 'string'}},
               'type': 'object'},
     'type': 'array'}

On instance:
    '{}'

from rembg.

aloeb-gh avatar aloeb-gh commented on September 26, 2024

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.

bg_cleaned_image = remove(data=my_image, session=rembg.new_session("sam", sam_prompt=[{"type": "point", "data": [724, 740], "label": 1}])

Error

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

Failed validating 'type' in schema:
                                       'type': 'array'},
                              'type': {'type': 'string'}},
               'type': 'object'},
     'type': 'array'}

On instance:
    '{}'

Hello,
Try with sam_prompt outside of the session argument.
For me it works with the following code :

session_rmbg = new_session(model_name="sam")
input ect...
output = remove(input, session=session_rmbg, sam_prompt=[{"type": 'point', "data": [1600, 2400], "label": 1}])

from rembg.

github-actions avatar github-actions commented on September 26, 2024

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

from rembg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.