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

Background somewhere removed between hairs and somewhere else not #114

Open
marcello-pietrobon opened this issue Apr 18, 2024 · 0 comments

Comments

@marcello-pietrobon
Copy link

Hello, thank you for your software. It's definitely doing what I need.

Yet I see that in a picture I have it does remove the background but still leaves some of it between the hairs in some places while in others that are similar it doesn't.

The question is if this could be improved or not, or maybe in a near future. :-)

Here below I show what I mean.

This is the original picture:
Persona1 org

Here the result with the medium model:
Persona1 brj

Here the mask (which I extracted from the result picture here above using GIMP):
Persona1 brj mask

BTW, I tried to get the mask directly from background-removal-js by using

    output: {
      quality: 0.8,
      format: 'image/png',
      type: 'foreground'
    }

in the example provided, but the output file looks exactly identical no matter if I use 'foreground' , 'background' or 'mask'.

Also the 'large' model doesn't seem to make any difference
(this I did it by setting

    const config = {
      model: 'large'
    }

and hacking .\node_modules\@imgly\background-removal-node\dist\resources.json by adding in it the lines:

,
  "/models/large": {
    "chunks": [
      {
        "hash": "17b7466d93bb60b0e88affa2b0e8b3eee309c7de183d394ce4b956339ebd95e6",
        "offsets": [
          0,
          176173887
        ]
      }
    ],
    "size": 176173887,
    "mime": "application/octet-steam"
  }

(but probably it's not the right way, though it seems to work, ... I don't know yet how to manually compile the source and manually installed in the .\node_modules\ subirectory).

I'm using background-removal-js installed on windows 10 with the command npm install @imgly/background-removal-node.

Kindest regards,
M

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant