INNER CODE UNIT · Python
bbox
zuruoke/watermark-removal · inpaint_model.py:267
bbox = (tf.constant(FLAGS.height//2), tf.constant(FLAGS.width//2),
tf.constant(FLAGS.height), tf.constant(FLAGS.width))
return self.build_infer_graph(FLAGS, batch_data, bbox, name)
def build_server_graph(self, FLAGS, batch_data, reuse=False, is_training=False):
"""
"""
# generate mask, 1 represents masked point
if FLAGS.guided:
batch_raw, edge, masks_raw = tf.split(batch_data, 3, axis=2)
edge = edge[:, :, :, 0:1] / 255.
edge = tf.cast(edge > FLAGS.edge_threshold, tf.float32)
else:
batch_raw, masks_raw = tf.split(batch_data, 2, axis=2)
masks = tf.cast(masks_raw[0:1, :, :, 0:1] > 127.5, tf.float32)
batch_pos = batch_raw / 127.5 - 1.