This script changes the background of an input image with given background. You can read more about segmentation here
The script setup.sh downloads the trained model and sets it up so that the seg.py script can understand.
./setup.sh
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
tensorflow, PIL
Susheelsk Code is originally utilized from https://github.com/susheelsk/image-background-removal