INNER CODE UNIT · Python
build_inpaint_net
zuruoke/watermark-removal · inpaint_model.py:28
def build_inpaint_net(self, x, mask, reuse=False,
training=True, padding='SAME', name='inpaint_net'):
"""Inpaint network.
Args:
x: incomplete image, [-1, 1]
mask: mask region {0, 1}
Returns:
[-1, 1] as predicted image
"""
xin = x
offset_flow = None
ones_x = tf.ones_like(x)[:, :, :, 0:1]
x = tf.concat([x, ones_x, ones_x*mask], axis=3)
# two stage network
cnum = 48
with tf.variable_scope(name, reuse=reuse), \