Skip to content

Commit

Permalink
modified stylize, removed examples
Browse files Browse the repository at this point in the history
  • Loading branch information
RobGeada committed Nov 20, 2017
1 parent b746181 commit e1cacb5
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file removed examples/1-content.jpg
Binary file not shown.
Binary file removed examples/1-output.jpg
Binary file not shown.
Binary file removed examples/1-style.jpg
Binary file not shown.
Binary file removed examples/2-content.jpg
Binary file not shown.
Binary file removed examples/2-output.jpg
Binary file not shown.
Binary file removed examples/2-style1.jpg
Binary file not shown.
Binary file removed examples/2-style2.jpg
Binary file not shown.
Binary file removed examples/tweaks/cwe01.jpg
Binary file not shown.
Binary file removed examples/tweaks/cwe10_default.jpg
Binary file not shown.
Binary file removed examples/tweaks/swe02.jpg
Binary file not shown.
Binary file removed examples/tweaks/swe14_pavg.jpg
Binary file not shown.
Binary file removed examples/tweaks/swe14_pmax.jpg
Binary file not shown.
Binary file removed examples/tweaks/swe14_pmax_pcyuv.jpg
Binary file not shown.
Binary file removed examples/tweaks/swe20.jpg
Binary file not shown.
16 changes: 16 additions & 0 deletions stylize.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import tensorflow as tf
import numpy as np

import os
from sys import stderr

from PIL import Image
Expand Down Expand Up @@ -143,6 +144,18 @@ def print_progress():
stderr.write('Optimization started...\n')
if (print_iterations and print_iterations != 0):
print_progress()

pretrained = False
print os.listdir(str(os.getcwd()))
if "fns.ckpt" in os.listdir(str(os.getcwd())):
print("Evaluating pre-trained model")
pretrained = True
saver = tf.train.Saver()
ckpt = tf.train.get_checkpoint_state(os.getcwd())

saver.restore(sess, ckpt.model_checkpoint_path)
iterations = 1;

for i in range(iterations):
stderr.write('Iteration %4d/%4d\n' % (i + 1, iterations))
train_step.run()
Expand Down Expand Up @@ -189,6 +202,9 @@ def print_progress():

# 5
img_out = np.array(Image.fromarray(combined_yuv, 'YCbCr').convert('RGB'))
if not pretrained:
saver = tf.train.Saver(write_version=tf.train.SaverDef.V1)
res = saver.save(sess, os.getcwd()+"/fns.ckpt")


yield (
Expand Down

0 comments on commit e1cacb5

Please sign in to comment.