Skip to content

Change the background of an image using semantic segmentation

Notifications You must be signed in to change notification settings

raikarsagar/image-background-changer

Repository files navigation

Background Changer using Semantic Segmentation with Tensorflow

This script changes the background of an input image with given background. You can read more about segmentation here

Setup

The script setup.sh downloads the trained model and sets it up so that the seg.py script can understand.

./setup.sh

Running the script

For better accuracy (slower approach) :

python3 seg_chng_background.py sample.jpg sample_background.jpeg sample_bgchanged.jpeg accurate

Use the script as specified below, to execute fast but lower accuracy model:

python3 seg_chng_background.py sample.jpg sample_background.jpeg sample_bgchanged.jpeg

Dependencies

tensorflow, PIL

Sample Result

Input

Background

Image with Background

Credits to

Susheelsk Code is originally utilized from https://github.com/susheelsk/image-background-removal

About

Change the background of an image using semantic segmentation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published