Example #1
0
            rr, cc = polygon(y, x, (WIDTH, HEIGHT))

            for i in range(3):
                data[0, rr, cc, i] += color
                # here's where you draw it. smooth. neat.
        xold = event.x
        yold = event.y


data = np.array((np.random.random((1, HEIGHT, WIDTH, 3)) - 0.5) * 4, dtype=float)

in_x = tf.placeholder(tf.float32, shape=(1, WIDTH, HEIGHT, 3))

with tf.variable_scope("gen", reuse=None) as scope:
    with tf.name_scope("1"):
        out_x = superres_model.superres_model(in_x)
with tf.variable_scope("gen", reuse=True) as scope:
    for i in range(6):
        with tf.name_scope(str(i + 2)):
            out_x = superres_model.superres_model(out_x)

restore_list = [x for x in tf.trainable_variables() if "ssskkds" not in x.name]

saver = tf.train.Saver(var_list=restore_list)

sess = tf.Session()

saver.restore(sess, sys.argv[1])


window = Tk()
Example #2
0
  crops = []
  for i in range(BATCH_SIZE):
    crops.append(tf.image.random_crop(jpg, [512, 512]))
  jpg = tf.pack(crops)
  #jpg = tf.image.resize_bilinear(jpg, [128, 128])

mix = tf.random_uniform([1]);
net_in = mix*jpg + (1.0-mix)*tf.truncated_normal(jpg.get_shape(), dtype=tf.float32, stddev=1)
l10 = net_in


all_images = []
  
with tf.variable_scope("gen", reuse=None) as scope:
  with tf.name_scope("1"):
    l10 = superres_model.superres_model(l10)
  all_images.append(l10)
with tf.variable_scope("gen", reuse=True) as scope:
  for i in range(2,8):
    with tf.name_scope(str(i)):
      l10 = superres_model.superres_model(l10)
    all_images.append(l10)

measure_images = tf.concat(0, [image[:,:,:,0:3] for image in [all_images[i] for i in [0, 2, 4, 6]]])
feedback_images = tf.concat(0, [image[:,:,:,0:3] for image in [all_images[i] for i in [6]]])
show_images = tf.concat(0, [image[0:1,:,:,0:3] for image in all_images])


tf.image_summary("gen", measure_images, max_images=1)
tf.image_summary("real", jpg, max_images=1)