imgly / background-removal-js

Remove backgrounds from images directly in the browser environment with ease and no additional costs or privacy concerns. Explore an interactive demo.
https://img.ly/showcases/cesdk/web/background-removal/web
GNU Affero General Public License v3.0
5.49k stars 339 forks source link

Simpliest example on how to make it a stand-alone service? #2

Closed Nakilon closed 1 year ago

Nakilon commented 1 year ago

Recently I was thinking about one hobby project that I don't know when I'll be ready to start but one of the key problems was to determine the locations of the main objects on photo/image. Having a service responding with the mask would be a solution. I have no clue in node.js but I would like to have it as a container. Maybe a Dockerfile or instructions on how to wrap it in the simpliest web server that would accept an image as a POST body and respond with the one with alpha channel?

AymericWilke commented 1 year ago

Not sure if a service removing the background would help you get masks of objects, but if you want to run a container with a background removal service you could do it with other libraries, like https://pypi.org/project/backgroundremover.

I did a (probably amateurish) docker container of that one: https://github.com/AymericWilke/removebg-docker.

DanielHauschildt commented 1 year ago

The library is currently working in the browser only since the HTMLCanvas is used for some resizing operations. This is however easily portable. Therefore, a nodejs version is one of the next things on the list.