diff --git a/.gitattributes b/.gitattributes index 818d649bf21cdef29b21f885c8f770f9baa1714e..af806b223695cc9fdfec484f9cfb988104bf27a1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -29,3 +29,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text *tfevents* filter=lfs diff=lfs merge=lfs -text +examples/outputs/starry_stanford_big.png filter=lfs diff=lfs merge=lfs -text +examples/outputs/starry_stanford_bigger.png filter=lfs diff=lfs merge=lfs -text diff --git a/examples/inputs/2022-06-14-144710_4.jpg b/examples/inputs/2022-06-14-144710_4.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a70995e386392af89b3e97f0ae54d80ed9ea50f0 Binary files /dev/null and b/examples/inputs/2022-06-14-144710_4.jpg differ diff --git a/examples/inputs/brad_pitt.jpg b/examples/inputs/brad_pitt.jpg new file mode 100644 index 0000000000000000000000000000000000000000..addd62f751cae420dad88813f2b00ad173ea8682 Binary files /dev/null and b/examples/inputs/brad_pitt.jpg differ diff --git a/examples/inputs/escher_sphere.jpg b/examples/inputs/escher_sphere.jpg new file mode 100644 index 0000000000000000000000000000000000000000..9918cf478f6f73e174d1df7b7e45a0e1284305ba Binary files /dev/null and b/examples/inputs/escher_sphere.jpg differ diff --git a/examples/inputs/frida_kahlo.jpg b/examples/inputs/frida_kahlo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e4dae25fb192a676c1d68fef43e4ef46930e7599 Binary files /dev/null and b/examples/inputs/frida_kahlo.jpg differ diff --git a/examples/inputs/golden_gate.jpg b/examples/inputs/golden_gate.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c6bd33e2fb17ef246c2695624de7a438eeee3000 Binary files /dev/null and b/examples/inputs/golden_gate.jpg differ diff --git a/examples/inputs/hoovertowernight.jpg b/examples/inputs/hoovertowernight.jpg new file mode 100644 index 0000000000000000000000000000000000000000..bf002a1596822cd3b908279a207f58377f70973d Binary files /dev/null and b/examples/inputs/hoovertowernight.jpg differ diff --git a/examples/inputs/picasso_selfport1907.jpg b/examples/inputs/picasso_selfport1907.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e6087827091c08630f3e4d42a2a1159f07ae08c5 Binary files /dev/null and b/examples/inputs/picasso_selfport1907.jpg differ diff --git a/examples/inputs/seated-nude.jpg b/examples/inputs/seated-nude.jpg new file mode 100644 index 0000000000000000000000000000000000000000..6a40b377a7b6adf205d47b5f4930ded39673d700 Binary files /dev/null and b/examples/inputs/seated-nude.jpg differ diff --git a/examples/inputs/shipwreck.jpg b/examples/inputs/shipwreck.jpg new file mode 100644 index 0000000000000000000000000000000000000000..73ecd1c50f498230f4c1c9198a000fc352a3600c Binary files /dev/null and b/examples/inputs/shipwreck.jpg differ diff --git a/examples/inputs/starry_night.jpg b/examples/inputs/starry_night.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d4db3c8e88f1bc85c7ca9c7f669da82ae51a402b Binary files /dev/null and b/examples/inputs/starry_night.jpg differ diff --git a/examples/inputs/starry_night_crop.png b/examples/inputs/starry_night_crop.png new file mode 100644 index 0000000000000000000000000000000000000000..9899d90aef7c75264cbecca80ed38bd4e21993b8 Binary files /dev/null and b/examples/inputs/starry_night_crop.png differ diff --git a/examples/inputs/starry_night_google.jpg b/examples/inputs/starry_night_google.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3f767fc59d7770eb7b3dfd894db74e002a3b90d7 Binary files /dev/null and b/examples/inputs/starry_night_google.jpg differ diff --git a/examples/inputs/the_scream.jpg b/examples/inputs/the_scream.jpg new file mode 100644 index 0000000000000000000000000000000000000000..ab54066362c8262fc48d59ea1b1336adc3385a2e Binary files /dev/null and b/examples/inputs/the_scream.jpg differ diff --git a/examples/inputs/tubingen.jpg b/examples/inputs/tubingen.jpg new file mode 100644 index 0000000000000000000000000000000000000000..1d271feb8dccad78d333bd469b047d9a6b258781 Binary files /dev/null and b/examples/inputs/tubingen.jpg differ diff --git a/examples/inputs/woman-with-hat-matisse.jpg b/examples/inputs/woman-with-hat-matisse.jpg new file mode 100644 index 0000000000000000000000000000000000000000..a4675c78d98afb52f4680f5bc151a9f09310f7e8 Binary files /dev/null and b/examples/inputs/woman-with-hat-matisse.jpg differ diff --git a/examples/outputs/golden_gate_escher.png b/examples/outputs/golden_gate_escher.png new file mode 100644 index 0000000000000000000000000000000000000000..3305ace742d2c4ebaa94ae97908db793e699093f Binary files /dev/null and b/examples/outputs/golden_gate_escher.png differ diff --git a/examples/outputs/golden_gate_kahlo.png b/examples/outputs/golden_gate_kahlo.png new file mode 100644 index 0000000000000000000000000000000000000000..43ce44cb0e9ba52a987b562e426cd81756de97aa Binary files /dev/null and b/examples/outputs/golden_gate_kahlo.png differ diff --git a/examples/outputs/golden_gate_matisse.png b/examples/outputs/golden_gate_matisse.png new file mode 100644 index 0000000000000000000000000000000000000000..6091b4cd8bdfd96bf5b823c9726c2eb6c7e8bd69 Binary files /dev/null and b/examples/outputs/golden_gate_matisse.png differ diff --git a/examples/outputs/golden_gate_scream.png b/examples/outputs/golden_gate_scream.png new file mode 100644 index 0000000000000000000000000000000000000000..9586ea409400338c0591ba1e4544e1dd8833b4dd Binary files /dev/null and b/examples/outputs/golden_gate_scream.png differ diff --git a/examples/outputs/golden_gate_seated.png b/examples/outputs/golden_gate_seated.png new file mode 100644 index 0000000000000000000000000000000000000000..5b20b96522690afb9b05c0cd0c8fbe04cf8e2c2d Binary files /dev/null and b/examples/outputs/golden_gate_seated.png differ diff --git a/examples/outputs/golden_gate_starry.png b/examples/outputs/golden_gate_starry.png new file mode 100644 index 0000000000000000000000000000000000000000..6fe125680031793e2370da6e42ba93a26ce73cb0 Binary files /dev/null and b/examples/outputs/golden_gate_starry.png differ diff --git a/examples/outputs/golden_gate_starry_scale05.png b/examples/outputs/golden_gate_starry_scale05.png new file mode 100644 index 0000000000000000000000000000000000000000..e62470a464f0990c81a7772cc2597923107ffb66 Binary files /dev/null and b/examples/outputs/golden_gate_starry_scale05.png differ diff --git a/examples/outputs/golden_gate_starry_scale1.png b/examples/outputs/golden_gate_starry_scale1.png new file mode 100644 index 0000000000000000000000000000000000000000..49e22f5223a406c52ee430462c01fbedd8e813c1 Binary files /dev/null and b/examples/outputs/golden_gate_starry_scale1.png differ diff --git a/examples/outputs/golden_gate_starry_scale2.png b/examples/outputs/golden_gate_starry_scale2.png new file mode 100644 index 0000000000000000000000000000000000000000..3b5d03d2acd2eb789077537775e132ed223bd3d3 Binary files /dev/null and b/examples/outputs/golden_gate_starry_scale2.png differ diff --git a/examples/outputs/golden_gate_starry_scream_3_7.png b/examples/outputs/golden_gate_starry_scream_3_7.png new file mode 100644 index 0000000000000000000000000000000000000000..cf2fe44425b580f796d09a36fdb88b867c75534a Binary files /dev/null and b/examples/outputs/golden_gate_starry_scream_3_7.png differ diff --git a/examples/outputs/golden_gate_starry_scream_5_5.png b/examples/outputs/golden_gate_starry_scream_5_5.png new file mode 100644 index 0000000000000000000000000000000000000000..baa60873ce1cc1db70343917aa0306dde4f369cc Binary files /dev/null and b/examples/outputs/golden_gate_starry_scream_5_5.png differ diff --git a/examples/outputs/golden_gate_starry_scream_7_3.png b/examples/outputs/golden_gate_starry_scream_7_3.png new file mode 100644 index 0000000000000000000000000000000000000000..34b0dfe562f50df0f165b878d9c4f2af45b8a0a6 Binary files /dev/null and b/examples/outputs/golden_gate_starry_scream_7_3.png differ diff --git a/examples/outputs/original_color/tubingen_composition_vii.png b/examples/outputs/original_color/tubingen_composition_vii.png new file mode 100644 index 0000000000000000000000000000000000000000..0f99d24fe7fb52ffbe27538763fad67507f7c18a Binary files /dev/null and b/examples/outputs/original_color/tubingen_composition_vii.png differ diff --git a/examples/outputs/original_color/tubingen_scream.png b/examples/outputs/original_color/tubingen_scream.png new file mode 100644 index 0000000000000000000000000000000000000000..b9791f030d06d9827b92b5cfa14499e8011a767f Binary files /dev/null and b/examples/outputs/original_color/tubingen_scream.png differ diff --git a/examples/outputs/original_color/tubingen_seated_nude.png b/examples/outputs/original_color/tubingen_seated_nude.png new file mode 100644 index 0000000000000000000000000000000000000000..f1633008f379eed5b53744845acc7ff4017ad828 Binary files /dev/null and b/examples/outputs/original_color/tubingen_seated_nude.png differ diff --git a/examples/outputs/original_color/tubingen_shipwreck.png b/examples/outputs/original_color/tubingen_shipwreck.png new file mode 100644 index 0000000000000000000000000000000000000000..e6b4d44b6abc3a077e2039efca8b353fb5e93bf7 Binary files /dev/null and b/examples/outputs/original_color/tubingen_shipwreck.png differ diff --git a/examples/outputs/original_color/tubingen_starry.png b/examples/outputs/original_color/tubingen_starry.png new file mode 100644 index 0000000000000000000000000000000000000000..15e426cbd809edc6b27f1c2871369d8ce059673f Binary files /dev/null and b/examples/outputs/original_color/tubingen_starry.png differ diff --git a/examples/outputs/pitt_picasso_content_0025_style_100.png b/examples/outputs/pitt_picasso_content_0025_style_100.png new file mode 100644 index 0000000000000000000000000000000000000000..299f616dfb6d0fb8e3f0b51943f4c37a616eb098 Binary files /dev/null and b/examples/outputs/pitt_picasso_content_0025_style_100.png differ diff --git a/examples/outputs/pitt_picasso_content_01_style_100.png b/examples/outputs/pitt_picasso_content_01_style_100.png new file mode 100644 index 0000000000000000000000000000000000000000..0767fbc90b6f2d38909c17b159de40106d0b9532 Binary files /dev/null and b/examples/outputs/pitt_picasso_content_01_style_100.png differ diff --git a/examples/outputs/pitt_picasso_content_1_style_100.png b/examples/outputs/pitt_picasso_content_1_style_100.png new file mode 100644 index 0000000000000000000000000000000000000000..b60defe06772e338282b2507bfba9f9d57a791a4 Binary files /dev/null and b/examples/outputs/pitt_picasso_content_1_style_100.png differ diff --git a/examples/outputs/pitt_picasso_content_5_style_100.png b/examples/outputs/pitt_picasso_content_5_style_100.png new file mode 100644 index 0000000000000000000000000000000000000000..4a4c075dc13a82d020b2ec6584cbd26f0ee7a94e Binary files /dev/null and b/examples/outputs/pitt_picasso_content_5_style_100.png differ diff --git a/examples/outputs/pitt_picasso_nin_cudnn.png b/examples/outputs/pitt_picasso_nin_cudnn.png new file mode 100644 index 0000000000000000000000000000000000000000..b7f26574a8c37c602983703c6345d9a2130763d5 Binary files /dev/null and b/examples/outputs/pitt_picasso_nin_cudnn.png differ diff --git a/examples/outputs/starry_stanford_big.png b/examples/outputs/starry_stanford_big.png new file mode 100644 index 0000000000000000000000000000000000000000..2b9e41aa819fa2a16e316adadc0d8e87621fe967 --- /dev/null +++ b/examples/outputs/starry_stanford_big.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0972eb593687214efa8e52b9e96977446c06688b93fc2c8293145f934de71155 +size 5531124 diff --git a/examples/outputs/starry_stanford_bigger.png b/examples/outputs/starry_stanford_bigger.png new file mode 100644 index 0000000000000000000000000000000000000000..926b02bd32503c881ca55fc38ea900ff0ffaceec --- /dev/null +++ b/examples/outputs/starry_stanford_bigger.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:521894f03b6e6bac2994f8b45106eeacf92e89c1a1331a23a16dfb8534e6803b +size 16068209 diff --git a/examples/outputs/tubingen_composition_vii.png b/examples/outputs/tubingen_composition_vii.png new file mode 100644 index 0000000000000000000000000000000000000000..ff3561056d2d8fed6c1a87f4cfd68de7fb317762 Binary files /dev/null and b/examples/outputs/tubingen_composition_vii.png differ diff --git a/examples/outputs/tubingen_scream.png b/examples/outputs/tubingen_scream.png new file mode 100644 index 0000000000000000000000000000000000000000..1607bb131cb0bd57d92aedef32ed7976206cc13c Binary files /dev/null and b/examples/outputs/tubingen_scream.png differ diff --git a/examples/outputs/tubingen_scream_composition_vii.png b/examples/outputs/tubingen_scream_composition_vii.png new file mode 100644 index 0000000000000000000000000000000000000000..ff0c163d6fbee5c56f6f44ae7ea171c8faa74e83 Binary files /dev/null and b/examples/outputs/tubingen_scream_composition_vii.png differ diff --git a/examples/outputs/tubingen_seated_nude.png b/examples/outputs/tubingen_seated_nude.png new file mode 100644 index 0000000000000000000000000000000000000000..c232dfb49c9b3a1fb5747bdcabde18190bcfd792 Binary files /dev/null and b/examples/outputs/tubingen_seated_nude.png differ diff --git a/examples/outputs/tubingen_seated_nude_composition_vii.png b/examples/outputs/tubingen_seated_nude_composition_vii.png new file mode 100644 index 0000000000000000000000000000000000000000..245d2e33a93ace895fc3d19c197de2f7c7fdaa82 Binary files /dev/null and b/examples/outputs/tubingen_seated_nude_composition_vii.png differ diff --git a/examples/outputs/tubingen_shipwreck.png b/examples/outputs/tubingen_shipwreck.png new file mode 100644 index 0000000000000000000000000000000000000000..ad69ce2ec5935666cc0ff1c97a36f3fe6592d61a Binary files /dev/null and b/examples/outputs/tubingen_shipwreck.png differ diff --git a/examples/outputs/tubingen_starry.png b/examples/outputs/tubingen_starry.png new file mode 100644 index 0000000000000000000000000000000000000000..dd8f6c610fdead22d9a80ba4b1a00b253e1fd1a9 Binary files /dev/null and b/examples/outputs/tubingen_starry.png differ diff --git a/examples/outputs/tubingen_starry_scream.png b/examples/outputs/tubingen_starry_scream.png new file mode 100644 index 0000000000000000000000000000000000000000..cc64e3398533473851843fe63430ce47df1162f6 Binary files /dev/null and b/examples/outputs/tubingen_starry_scream.png differ diff --git a/examples/outputs/tubingen_starry_seated.png b/examples/outputs/tubingen_starry_seated.png new file mode 100644 index 0000000000000000000000000000000000000000..cde28d2aaa4a1205cb0d69a0d9eb843cad7694b4 Binary files /dev/null and b/examples/outputs/tubingen_starry_seated.png differ diff --git a/examples/scripts/starry_stanford.sh b/examples/scripts/starry_stanford.sh new file mode 100644 index 0000000000000000000000000000000000000000..5967c0dd25951ce7abcf1ef182d652b39f3c17a9 --- /dev/null +++ b/examples/scripts/starry_stanford.sh @@ -0,0 +1,92 @@ +# To run this script you'll need to download the ultra-high res +# scan of Starry Night from the Google Art Project, using this command: +# wget -c https://upload.wikimedia.org/wikipedia/commons/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg -O starry_night_gigapixel.jpg +# Or you can manually download the image from here: https://commons.wikimedia.org/wiki/File:Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg + +STYLE_IMAGE=starry_night_gigapixel.jpg +CONTENT_IMAGE=examples/inputs/hoovertowernight.jpg + +STYLE_WEIGHT=5e2 +STYLE_SCALE=1.0 + +STYLE_WEIGHT2=2500 # Style weight for image size 2048 and above + +PYTHON=python3 # Change to Python if using Python 2 +SCRIPT=neural_style.py +GPU=0 + +NEURAL_STYLE=$PYTHON +NEURAL_STYLE+=" " +NEURAL_STYLE+=$SCRIPT + +# Uncomment if using pip package +#NEURAL_STYLE=neural-style + + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT \ + -image_size 256 \ + -output_image out1.png \ + -tv_weight 0 \ + -gpu $GPU \ + -backend cudnn -cudnn_autotune + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -init image -init_image out1.png \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT \ + -image_size 512 \ + -num_iterations 500 \ + -output_image out2.png \ + -tv_weight 0 \ + -gpu $GPU \ + -backend cudnn -cudnn_autotune + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -init image -init_image out2.png \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT \ + -image_size 1024 \ + -num_iterations 200 \ + -output_image out3.png \ + -tv_weight 0 \ + -gpu $GPU \ + -backend cudnn -cudnn_autotune + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -init image -init_image out3.png \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT2 \ + -image_size 2048 \ + -num_iterations 200 \ + -output_image out4.png \ + -tv_weight 0 \ + -gpu $GPU \ + -backend cudnn + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -init image -init_image out4.png \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT2 \ + -image_size 2350 \ + -num_iterations 200 \ + -output_image out5.png \ + -tv_weight 0 \ + -gpu $GPU \ + -backend cudnn -optimizer adam diff --git a/examples/scripts/starry_stanford_bigger.sh b/examples/scripts/starry_stanford_bigger.sh new file mode 100644 index 0000000000000000000000000000000000000000..c574758ea19277d12c91e0d75548f8b7ddcf123f --- /dev/null +++ b/examples/scripts/starry_stanford_bigger.sh @@ -0,0 +1,108 @@ +# To run this script you'll need to download the ultra-high res +# scan of Starry Night from the Google Art Project, using this command: +# wget -c https://upload.wikimedia.org/wikipedia/commons/e/ea/Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg -O starry_night_gigapixel.jpg +# Or you can manually download the image from here: https://commons.wikimedia.org/wiki/File:Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg + +STYLE_IMAGE=starry_night_gigapixel.jpg +CONTENT_IMAGE=examples/inputs/hoovertowernight.jpg + +STYLE_WEIGHT=5e2 +STYLE_SCALE=1.0 + +STYLE_WEIGHT2=2500 # Style weight for image size 2048 and above + +PYTHON=python3 # Change to Python if using Python 2 +SCRIPT=neural_style.py +GPU=0 + +NEURAL_STYLE=$PYTHON +NEURAL_STYLE+=" " +NEURAL_STYLE+=$SCRIPT + +# Uncomment if using pip package +#NEURAL_STYLE=neural-style + + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT \ + -image_size 256 \ + -output_image out1.png \ + -tv_weight 0 \ + -gpu $GPU \ + -backend cudnn -cudnn_autotune + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -init image -init_image out1.png \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT \ + -image_size 512 \ + -num_iterations 500 \ + -output_image out2.png \ + -tv_weight 0 \ + -gpu $GPU \ + -backend cudnn -cudnn_autotune + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -init image -init_image out2.png \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT \ + -image_size 1024 \ + -num_iterations 200 \ + -output_image out3.png \ + -tv_weight 0 \ + -gpu $GPU \ + -backend cudnn -cudnn_autotune + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -init image -init_image out3.png \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT2 \ + -image_size 2048 \ + -num_iterations 200 \ + -output_image out4.png \ + -tv_weight 0 \ + -gpu $GPU \ + -backend cudnn + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -init image -init_image out4.png \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT2 \ + -image_size 3620 \ + -num_iterations 200 \ + -output_image out5.png \ + -tv_weight 0 \ + -gpu 0,1,2,3 \ + -multidevice_strategy 3,6,12 \ + -backend cudnn + +$NEURAL_STYLE \ + -content_image $CONTENT_IMAGE \ + -style_image $STYLE_IMAGE \ + -init image -init_image out5.png \ + -style_scale $STYLE_SCALE \ + -print_iter 1 \ + -style_weight $STYLE_WEIGHT2 \ + -image_size 4016 \ + -num_iterations 200 \ + -output_image out6.png \ + -tv_weight 0 \ + -gpu 0,1,2,3,4,5,6,7 \ + -multidevice_strategy 2,4,6,9,15,18,22 \ + -backend cudnn