https://github.com/alyetama/rembg-online
Web app to remove images background
https://github.com/alyetama/rembg-online
python remove-background streamlit streamlit-application
Last synced: 10 months ago
JSON representation
Web app to remove images background
- Host: GitHub
- URL: https://github.com/alyetama/rembg-online
- Owner: Alyetama
- License: mit
- Created: 2022-05-16T08:00:29.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-29T07:00:30.000Z (about 3 years ago)
- Last Synced: 2023-05-20T17:15:32.222Z (about 3 years ago)
- Topics: python, remove-background, streamlit, streamlit-application
- Language: Python
- Homepage:
- Size: 31.3 KB
- Stars: 4
- Watchers: 2
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rembg App
Web app to remove images background using [rembg](https://github.com/danielgatis/rembg).
[](https://github.com/Alyetama/Rembg-Online/actions/workflows/docker-build.yml) [](https://github.com/Alyetama/Remove-Background-Online/actions/workflows/pages/pages-build-deployment) [](https://github.com/Alyetama/Remove-Background-Online/actions/workflows/vercel-deploy.yml) [](https://hub.docker.com/r/alyetama/rembg-app) [](https://www.python.org/downloads/) [](https://github.com/streamlit/streamlit/releases/tag/1.10.0) [](https://www.python.org/dev/peps/pep-0008/)
## Deployment
```sh
git clone https://github.com/Alyetama/Rembg-Online.git
cd Rembg-Online
```
### Option 1: Run locally
```sh
pip install -r requirements.txt
streamlit run streamlit_app.py
```
### Option 2: Free cloud hosting on Streamlit Cloud
- [Fork this repository](https://github.com/Alyetama/Rembg-App/fork).
- Go to [this page]( https://share.streamlit.io/deploy), select your fork under `Repository`, then click `Deploy!`.

### Option 3: Docker
```
docker run \
-p 8501:8501 \
-v "${PWD}/.streamlit:/home/app/.streamlit" \
alyetama/rembg-app:latest
```
#### Docker Compose
```
docker-compose up -d
```
##### Updating
```sh
docker pull alyetama/rembg-app:latest
```
If you're using the pre-built docker image in docker-compose, you can update the image by running:
```sh
docker-compose down
docker-compose pull
docker-compose up -d
```
## Configuration
- To configure the streamlit application, edit `.streamlit/config.toml` ([configuration reference](https://docs.streamlit.io/library/advanced-features/configuration)).
- To configure the maximum number of uploaded files (*default: 10*), set the environment variable `MAX_FILES`:
- Option 1: Export the variable.
```sh
export MAX_FILES=20
```
- Option 2: Edit the value of `MAX_FILES` in `.env`.
```sh
mv .env.example .env
nano .env # or any other text editor
```
- On Streamlit Cloud: Go to the app settings -> Secrets -> `MAX_FILES = 20` -> save.
## Notes
- The very first processed image after starting the app may take few minutes, because the backend model is being downloaded for the first time.