Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Yanhong Zeng (FA Talent)
Yanhong Zeng (FA Talent) update readme
Latest commit 0afadfa Jun 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs update readme Apr 16, 2019
tensorflow/layers release implementation of ATN Jun 11, 2019
.gitignore Initial commit Mar 29, 2019
LICENSE Initial commit Mar 29, 2019
README.md update readme Jun 11, 2019

README.md

PEN-Net for Image Inpainting

PEN-Net

Arxiv |

Learning Pyramid-Context Encoder Network for High-Quality Image Inpainting.
Yanhong Zeng, Jianlong Fu, Hongyang Chao, and Baining Guo.
In CVPR 2019 (Poster).

Usage

# tensorflow version, when L=7
import tensorflow as tf
from layers.atnconv import AtnConv
cnum = 32
x = conv2d(input, cnum//2, ksize=3, stride=1)

# encode
enc_feats = []
dims = [cnum * i for i in [1, 2, 4, 8, 8, 8]]
for i in range(len(dims)):
  enc_feats.append(x)
  x = conv2d(x, dims[i], ksize=3, stride=2)
latent_feat = x

# attention transfer networks
attn_feats = []
x = latent_feat
for i in range(len(dims)):
  x = AtnConv(enc_feats[-(i+1)], x, mask)
  attn_feats.append(x)

# decode
x = latent_feat
dims = [cnum * i for i in [1./2, 1, 2, 4, 8, 8]]
for i in range(len(dims)):
  x = deconv2d(x, dims[-(i+1)], ksize=3, stride=2)
  x = tf.concat([x, attn_feats[i]], axis=3)

output = conv2d(x, 3, ksize=1, stride=1)

Citation

If any part of our paper and code is helpful to your work, please generously cite with:

@inproceedings{yan2019PENnet,
  author = {Zeng, Yanhong and Fu, Jianlong and Chao, Hongyang and Guo, Baining},
  title = {Learning Pyramid-Context Encoder Network for High-Quality Image Inpainting},
  booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
  month = {June},
  year = {2019}
}

License

Licensed under an MIT license.

You can’t perform that action at this time.