Skip to content

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

License

Notifications You must be signed in to change notification settings

sarfaraz1373/background-remover-django

 
 

Repository files navigation

Background remover

Remove background from images using pre-trained AI model.
View Demo »

About The Project

Screenshot

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!

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 68.8%
  • HTML 30.5%
  • Procfile 0.7%