/DeepDream.jl

Implementation of Google's Deep Dream in Julia using Flux

Primary LanguageJuliaOtherNOASSERTION

DeepDream

NOTE : This project was meant for Julia 0.6. So it will fail to work with Julia 1.0 and the latest tagged version of Flux. However, an update is WIP

NOTE : If there is no GPU support available please checkout the cpu branch of this repo. The cpu code is not thoroughly tested.

INSTALLATION INSTRUCTIONS

Run this command in the Julia REPL

julia> Pkg.clone("https://github.com/avik-pal/DeepDream.jl.git")

USAGE INSTRUCTIONS

  1. Inorder to generate dreams without using octaves run the following command with your own parameters
julia> img = load_image("./examples/sky.jpg")
julia> load_model(5)
julia> DeepDream.make_step(img, 10, 0.005, true, "./examples/sky_dream_new.jpg")

Make sure to pass all the arguments to the make_step function call to avoid errors. Refer to the function definition to understand what each parameter means.

  1. To make use of octaves run the following commands
julia> img = load_image("./examples/sky.jpg")
julia> load_model(5)
julia> deepdream(img, 10, 0.005, 1.4, 4, "./examples/sky_dream_new.jpg")

Also be sure to checkout the function definition

  1. Incase you want to use any other model than the VGG19 model make sure to pass a function to load_model() which returns the model you want to use

  2. To generate guided dreams run the following code.

julia> guide = load_guide_image("./examples/rio.jpg")
julia> img = load_image("./examples/sky.jpg")
julia> load_model(5)
julia> deepdream(img, 10, 0.005, 1.4, 4, "./examples/sky_dream_guided_new.jpg", guided = true)

The guided_step function might be used independently like the make_step function.

  1. Even easier method is to place all your images in a ./images directory and call the function dream_batch function. Send a guiding image if necessary.

  2. recurdream might be used to generate frames from a given image and using writevideo after that generates a video file.

More indepth documentation is available for each and every function.

SOME EXAMPLES

Original Image Generated Image
Sky Deepdream on Sky
Game Deepdream on Game
Rio Deepdream on Rio
Rio Deepdream on Rio
Statue of Liberty Deepdream on Statue of Liberty
Original Image Guiding Image Generated Image
Sky Flowers Sky Dream guided by Flower
Sky Flowers Sky Dream guided by Flower

IMPLEMENTED

  1. Utilities to load, save and generate images
  2. Perform operations on Image
    • Zoom
  3. Utilities to load models
  4. Deep Dream Generator (non-guided)
  5. Generate deep dreams using Octaves
  6. Guided Deep Dreams