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.89k stars 362 forks source link

Docker to only serve the app and download images without using S3? #60

Open maxime1992 opened 1 year ago

maxime1992 commented 1 year ago

Hello,

has anybody created a docker container that'd let us spawn a container that'd serve the frontend in a very basic way and let us upload images then download them through the interface without using S3 in between? Just on disk or in memory and as soon as it's downloaded the image would be removed from the server?

tsibg commented 1 year ago

Not sure if it will help you, but I'm also playing around with this use-case - user can select an image and get the result. However, processing it only on the frontend. So NO Docker and without backend, no S3, no file management. Just a simple React App, based on the example.

Check it if it works for you: https://github.com/tsibg/react-background-remover Still WIP, but works as a standalone - hosted preview https://react-background-remover-seven.vercel.app/

React is easy to build into static files to be hosted, so I decided to not complicate it with Docker, as I will not need Backend or server-processing for my exact project.

maxime1992 commented 1 year ago

Love the idea, that's great :fire:!

perroudsky commented 1 year ago

@tsibg nice! Do you think the lib could work in react-native ?

tsibg commented 1 year ago

@tsibg nice! Do you think the lib could work in react-native ?

I believe someone from the imgly team or repository maintainers would be able to answer you more accurately. Why don't you open new issue to ask as it gets out of scope of this one.

P.s. Just out of curiosity: I just scrolled around the repo code and it seems like they are using onnxruntime-web for Web, and other npm package for Node. So, you could try with onnxruntime-react-native ;) Check packages/web/src/onnx.ts.

perroudsky commented 1 year ago

Indeed I should ! Thanks man

DanielHauschildt commented 1 year ago

@maxime1992 You should be able to build a docker image and serve the assets from within the docker image easily. You have to copy the assets locally to the public directory and serve them locally:

https://github.com/imgly/background-removal-js/tree/main/packages/web#custom-asset-serving