Skip to content

Commit

Permalink
Loading seed from an image.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjc committed Apr 18, 2016
1 parent 7f637fa commit d497cc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Installation & Setup

This project requires Python 3.4+ and you'll also need ``numpy`` and ``scipy`` (numerical computing libraries) as well as ``python3-dev`` installed system-wide. If you want more detailed instructions, follow these:

0. Use Pre-Installed `Docker Container <https://github.com/alexjc/neural-doodle/issues/61>`_ or `Amazon Image <https://github.com/alexjc/neural-doodle/issues/54>`_ (beginner).
0. Use Prepared `Docker Container <https://github.com/alexjc/neural-doodle/issues/61>`_ or `Amazon Image <https://github.com/alexjc/neural-doodle/issues/54>`_ **(beginner)**
1. `Linux Installation of Lasagne <https://github.com/Lasagne/Lasagne/wiki/From-Zero-to-Lasagne-on-Ubuntu-14.04>`_ **(recommended)**
2. `Mac OSX Installation of Lasagne <http://deeplearning.net/software/theano/install.html#mac-os>`_ **(intermediate)**
3. `Windows Installation of Lasagne <https://github.com/Lasagne/Lasagne/wiki/From-Zero-to-Lasagne-on-Windows-7-%2864-bit%29>`_ **(expert)**
Expand Down
4 changes: 4 additions & 0 deletions doodle.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ def run(self):
if args.seed == 'previous':
Xn = scipy.misc.imresize(Xn[0], shape, interp='bicubic')
Xn = Xn.transpose((2, 0, 1))[np.newaxis]
if os.path.exists(args.seed):
seed_image = scipy.ndimage.imread(args.seed, mode='RGB')
self.seed_image = self.model.prepare_image(seed_image)
Xn = self.seed_image[0] + self.model.pixel_mean

# Optimization algorithm needs min and max bounds to prevent divergence.
data_bounds = np.zeros((np.product(Xn.shape), 2), dtype=np.float64)
Expand Down

0 comments on commit d497cc3

Please sign in to comment.