An open API service indexing awesome lists of open source software.

https://github.com/balewgize/background-remover-django

Remove background from images using pre-trained ML models. (Django)
https://github.com/balewgize/background-remover-django

ai background-image background-removal django

Last synced: about 1 year ago
JSON representation

Remove background from images using pre-trained ML models. (Django)

Awesome Lists containing this project

README

          


Background remover


Remove background from images using pre-trained AI model.


View Demo »



## About The Project

[![Screenshot](static/images/screenshot.png?raw=true "Tomar")](#)

A web app built with Python/Django that enables users to remove background from images using pre-trained AI model. It allows users to download the final result image with a transparent background.

It does well for most images that doesn't have messy background but I'm sure you won't expect photoshop like results :)

### Deployment
**Note:** The project is production ready and can be easily deployed. But it requires good amount of resource to run ML models used by **rembg** in the cloud. At the moment, I'm unable to deploy the django version for free.

So I used ```Streamlit``` to deploy the main script with enchanced functionality. Check here

### Features
- Downloadable final result
- Transparent background
- Production ready

(back to top)

### Built With
- Python/Django
- Bootstrap
- rembg
- Dropbox

(back to top)

## Getting Started

To get a local copy up and running follow these simple steps.

### Prerequisites

* Django

### Installation

1. Clone the repo and navigate to ```background-remover-django``` directory
```
git clone https://github.com/balewgize/background-remover-django.git
```
```
cd background-remover-django
```
2. Install required packages (virtual environments recommended)
```
python3 -m venv venv && source venv/bin/activate
```
```
pip install -r requirements/local.txt
```
3. Provide credentials in ```.env``` (example in .env.dev file)
```
DJANGO_SECRET_KEY=
```
Use this command to generate strong ```SECRET_KEY```
```
python3 -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
```
4. Apply migrations and start the server
```
python manage.py migrate
```
```
python manage.py runserver
```
5. Goto http://127.0.0.1:8000 on your browser

(back to top)

Thanks!