README.md 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
# Image Inpainting with Learnable Bidirectional Attention Maps.
The PaddlePaddle implementation of Image Inpainting with Learnable Bidirectional Attention Maps in ICCV 2019, by Chaohao Xie, Shaohui Liu, Chao Li, Ming-Ming Cheng, Wangmeng Zuo, Xiao Liu, Shilei Wen, Errui Ding.\
<https://arxiv.org/abs/1909.00968>

## 1. Requirements.

PaddlePaddle version == 1.6.\
Python version == 3.6.\
NCCL for multiple GPUs.

## 2. Usage.

Download the pretrained models by <https://pan.baidu.com/s/1Xpgj6pcBTYYYxsAlJrFXgg>, password: apfo.\
Run the test script.
```
sh test.sh
```

```
mkdir -p results/paris

FLAGS_fraction_of_gpu_memory_to_use=0.1 \
CUDA_VISIBLE_DEVICES=0 \
FLAGS_eager_delete_tensor_gb=0.0 \
FLAGS_fast_eager_deletion_mode=1 \
python -u test.py \
--pretrained_model 'pretrained_models/LBAM_ParisStreetView' \  # path to the pretrained model
--imgfn 'imgs/paris/pic.png' \                                 # input picture.
--maskfn 'imgs/paris/mask.png' \                               # mask.
--resultfn 'results/paris'                                     # folder for the result.
```
Input picture:\
![avatar](imgs/paris/pic.png)

Input mask:\
![avatar](imgs/paris/mask.png)

Inpainting result:\
![avatar](results/paris/pic.png)