

Vincent van Gogh – Wheat Field with CypressesĪnd then I passed each of them through the demo_guided.py script detailed above.In order to test this out, I collected images of the following pieces of work: What would the results look like? Would the artistic style of each painting be transferred to the other? Which got me thinking - what would happen if I took some well-known paintings from extremely famous artists such as Andy Warhol, MC Escher, Pablo Picasso, Jackson Pollock, and Vincent van Gogh and used them as inputs and guides to each other? Here I use a seed image of Vincent van Gogh’s Starry Night and apply to an image of clouds: Figure 1: An example of applying guided dreaming using Starry Night and a cloud image.Īs you can see, the output cloud image after applying guided dreaming appears to mimic many of the brush strokes of Van Gogh’s painting. What’s nice about this approach is that we can “guide” what the output image looks like. You’ll also need a working installation of Caffe.
#DEEP DREAMER MAC RUNNING OUT OF MEMORY INSTALL#
If you don’t already have bat-country installed, either pull down the code from the GitHub repo or use pip to install it on your system: pip install bat-country or pip install -upgrade bat-country. Iter_n=20, objective_fn=BatCountry.guided_objective, Image = bc.dream(np.float32(Image.open(args.image)), end=args.layer, # construct the argument parser and parse the argumentsĪp.add_argument("-b", "-base-model", required=True, help="base model path")Īp.add_argument("-l", "-layer", type=str, default="inception_4c/output",Īp.add_argument("-i", "-image", required=True, help="path to base image")Īp.add_argument("-g", "-guide-image", required=True, help="path to guide image")Īp.add_argument("-o", "-output", required=True, help="path to output image")įeatures = bc.prepare_guide(Image.open(args.guide_image), end=args.layer) Here’s some quick sample code: # import the necessary packages Using bat-country, it’s just as easy to perform guided dreaming as deep dreaming.

This method passes your input image through the network in a similar manner, but this time using your seed image to guide and influence the output.
#DEEP DREAMER MAC RUNNING OUT OF MEMORY UPDATE#
Last Friday the Google Research team posted an update to their deep dream working demonstrating it was possible to guide your dreaming process by supplying a seed image.

In the remainder of this blog post we’ll play around with the new bat-country update to perform guided dreaming - and even use it to generate our own art using guided deep dreaming! Guided deep dreaming I simply defined a new objective function, allowing the step function to be further customized, and we’re done! In fact, defining your own custom objective function is the the exact route I took when extending bat-country. Want to change the objective function? Again, just define your own objective and you’re good to go. Define your own custom processor and pass it in. Want to change how each image is pre-processed or post-processed? No problem. The secret to this quick turnaround is the extensibility of the BatCountry class where nearly every function and every method can be overridden and extended.

I honestly spent more time running the Python scripts to gather example images and updating the documentation than I did updating the codebase. Truth be told, it only took ~20 minutes from start-to-finish to get the code together. The results were quite impressive - so I decided to port the functionality to bat-country. One of the main benefits of the bat-country Python package for deep dreaming and visualization is its ease of use, extensibility, and customization.Īnd let me tell you, that customization really came in handy last Friday when the Google Research team released an update to their deep dream work, demonstrating a method to “guide” your input images to visualize the features of a target image.
