Justin Johnson provides detailed information on GitHub concerning how to use the various neural-style parameters. The following will only discuss the settings specific to Painting Movies.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#!/bin/bash th neural_style.lua \ -style_image style.png \ -content_image content.png -output_image output.png \ -gpu 0 \ -seed -1 \ -image_size 1280 \ -save_iter 100 \ -num_iterations 1000 \ -content_weight 50 \ -style_weight 1000 \ -style_scale 1 \ -original_colors 0 \ -init image \ -backend cudnn \ -cudnn_autotune \ -optimizer cudnn \ |
Style image (Kandinskys Black and Violett from 1923) and target (Source: PD/Rada)
The GPU-based rendering time for a film frame with a resolution of 1280 x 720 pixels and 1000 iterations using the VGG-19 model by Leon Gatys totals around seven and a half minutes. The processing time for a 800 x 450 pixel image is three minutes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
#!/bin/bash th neural_style.lua \ -style_image style.png \ -content_image content.png -output_image output.png \ -model_file models/nin_imagenet_conv.caffemodel \ -proto_file models/train_val.prototxt \ -content_layers relu0,relu3,relu7,relu12 \ -style_layers relu0,relu3,relu7,relu12 \ -gpu 0 \ -seed -1 \ -image_size 1280 \ -save_iter 100 \ -num_iterations 1000 \ -content_weight 50 \ -style_weight 1000 \ -style_scale 1 \ -original_colors 0 \ -init image \ -backend cudnn \ -cudnn_autotune \ -optimizer adam \ |
Computed image with VGG-19 and NIN-Imagenet model
By using the NIN-Imagenet model, the processing time for a film frame with a resolution of 1280 x 720 pixels and 1000 iterations can be reduced to around 45 seconds. However, the quality of the results can fluctuate strongly depending on the source and target images selected.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
#!/bin/bash th neural_style.lua \ -style_image style.png \ -content_image content.png -output_image output.png \ -gpu 0 \ -seed -1 \ -image_size 1600 \ -save_iter 100 \ -num_iterations 2000 \ -content_weight 10 \ -style_weight 1000 \ -style_scale 1 \ -original_colors 1 \ -init image \ -backend cudnn \ -cudnn_autotune \ -optimizer cudnn \ |
Test image with original colours and 2000 iterations
The maximum output on the test workstation is 1600 x 900 pixels. The computing time for 2000 iterations is 23 minutes. The test image output in the example features the original colours.
Installation of neural-style
Working with neural-style
Style Transfer for Video Clips
Post-production
Alternative Techniques