Skip to content

Reproducing Other DeepDream Project Results

ProGamerGov edited this page Apr 18, 2020 · 11 revisions

TensorFlow 2.x DeepDream Tutorial


First download the image used in the tutorial via wget (Linux) or manually on Windows:

wget https://www.tensorflow.org/tutorials/generative/deepdream_files/output_Y5BPgc8NNbG0_0.png

Download the Keras Inception V3 model either manually or by using the download_models.py script:

python models/download_models.py -models keras-inceptionv3

Now you can run neural-dream with:

python neural_dream.py -backend cudnn -dream_layers mixed4,mixed5 -content_image output_Y5BPgc8NNbG0_0.png

To use tiling:

python neural_dream.py -backend cudnn -dream_layers mixed4,mixed5 -content_image output_Y5BPgc8NNbG0_0.png -tile_size 256 -print_tile 1

The -jitter parameter controls random image shifts, and the -disable_roll flag will disable the random full image shifts used when tiling (only random shifts on tiles will be used if -disable_roll is enabled when tiling).


TensorFlow 1.x DeepDream Tutorial

Download the Inception5h model either manually or by using the download_models.py script:

python models/download_models.py -models tensorflow-inception5h

To reproduce the basic output:

python neural_dream.py -content_image input.png -dream_layers mixed4d_3x3_bottleneck_pre_relu_conv -channels 139 -model_file models/inception5h.pth -loss_mode mean

With Laplacian Pyramid Gradient Normalization:

python neural_dream.py -content_image input.png -dream_layers mixed3b_1x1_pre_relu_conv -channels 139 -model_file models/inception5h.pth -loss_mode mean -lap_scale 4 -sigma 1,4

Protobuf-Dreamer

Download the Inception5h model either manually or by using the download_models.py script:

python models/download_models.py -models tensorflow-inception5h

To replicate the advanced command set:

python neural_dream.py -content_image input.png -dream_layers mixed4d_3x3_bottleneck_pre_relu_conv -channels 139 -octave_iter 10 --tile_size 512 -image_size 1024 -model_file models/inception5h.pth

kesara's deepdreamer

Download the Places 205 GoogleNet model either manually or by using the download_models.py script:

python models/download_models.py -models caffe-googlenet-places205

Now you can run neural-dream with:

python neural_dream.py -backend cudnn -dream_layers inception_4c_output -model_file models/googlenet_places205.pth -clamp -zoom 98

To adjust the contrast of the output image:

python neural_dream.py -backend cudnn -dream_layers inception_4c_output -model_file models/googlenet_places205.pth -adjust_contrast 99.98

To create an output GIF:

mkdir outputs # Or manually create folder named "outputs" on Windows

python neural_dream.py -backend cudnn -dream_layers inception_4c_output -model_file models/googlenet_places205.pth -output_images outputs/out.png -create_gif -frame_duration 100

Clone this wiki locally