We improves the image blending method Deep Image Blending by boosting up speed of the first stage of it's process at least 1000x. Our code is based on their repository.
python3 train.py --trainset=path/to/trainset --target_file=./data/0_target.png
python train.py --grad_weight=1e3 --style_weight=1e2 --content_weight=1e0
python train.py --grad_weight=1e3 --style_weight=1e2 --content_weight=1e0
python train.py --grad_weight=1e3 --style_weight=1e2 --content_weight=1e0 --resume=./results/mydir/snapshots/mysnapshot.pt --optim=results/mydir/snapshots/mysnapshot_optim.pt
python inference.py --preset=0 --snapshot=./pretrained/data0_10.pt
python inference.py --snapshot=./results/mydir/snapshots/mysnapshot.pt --source_file=data/0_source.png --mask_file=data/0_mask.png --target_file=data/0_target.png --x=240 --y=350
python second_stage.py --target_file=./data/0_target.png --source_file=./my_first_stage_result.png
python traiditional.py --preset=0
We used MSRA10K and MSRA-B, total 15K pairs of (object image, binary mask).
In ./pretrained
, we provide pretrained models for images of ./data
.