Change background of image using semantic segmentation implemented in Pytorch trained on HRNet (Link)
Click and try here (Link)
- Clone this repository
git clone https://github.com/Garvit-32/BG-changer.git
- Install all the dependencies
pip install -r requirements.txt
- Download weights from here
- Run inference
python main.py --image <path to foreground image> --bg_image <path to background image> --weights <path to weights>
Example
python main.py --image demo_images/image1.jpg --bg_image demo_images/background1.jpg --weights hrnetv2_hrnet18_person_dataset_120.pth
Background image
Foreground image