A tool to remove a background from a portrait image using Tensorflow
The program removes the background from portrait photos
Differences from the original script:
- Tensorflow 2.0 compatible
- Added comments to the code.
- Added
tqdm
progress bar. - Removes background from image without loss of image resolution.
- The script now not only processes a single file, but can also process all images from the input folder and save them in the output folder with the same name.
- New sample images.
wget
for setup.py!
tensorflow, pillow, tqdm, numpy, scipy
for main.py!
- Clone this repository
- Install all the dependencies from requirements.txt via
pip3 install -r requirements.txt
- Run
./setup.bat
This setup.bat script loads the trained model.
- Clone repository:
git clone https://github.com/OPHoperHPO/image-background-remove-tool
- Install all the dependencies from requirements.txt:
pip3 install -r requirements.txt
- Run
./setup.sh
This setup.sh script loads the trained model.
python3 main.py <input_path> <output_path> <model_type>
<input_path>
- path to input file or dir.<output_path>
- path to output file or dir.<model_type>
- can bexception_model
ormobile_net_model
. The first model has better quality, but it runs much slower than the second.
Note: See sample scripts for more information on using the program.
1) Add a graphical interface. (0% done)