The remove-bg.py file is a python script that removes all the parts of an image except the regions that represent a class that we want to detect. It then saves the resulting picture with name 'removed_bg.jpg'
- numpy
- torch
- torchvision
- PIL
- matplotlib
to run the program:
git clone https://github.com/ChuckTG/Segment_Removal_Pytorch_FCN-ResNet.git
cd Segment_Removal_Pytorch_FCN-ResNet
python remove_bg.py
This is an output produced by the script:
The FCN-ResNet is loaded from torchvision.models.segmentation, it is a Fully Convolutional Network as proposed by Evan Shelhamer et.al and has the ResNet-101 model as backbone.