INNER CODE UNIT · Python
build_gan_discriminator
zuruoke/watermark-removal · inpaint_model.py:124
def build_gan_discriminator(
self, batch, reuse=False, training=True):
with tf.variable_scope('discriminator', reuse=reuse):
d = self.build_sn_patch_gan_discriminator(
batch, reuse=reuse, training=training)
return d
def build_graph_with_losses(
self, FLAGS, batch_data, training=True, summary=False,
reuse=False):
if FLAGS.guided:
batch_data, edge = batch_data
edge = edge[:, :, :, 0:1] / 255.
edge = tf.cast(edge > FLAGS.edge_threshold, tf.float32)
batch_pos = batch_data / 127.5 - 1.
# generate mask, 1 represents masked point
bbox = random_bbox(FLAGS)
regular_mask = bbox2mask(FLAGS, bbox, name='mask_c')