diff options
| author | jules <jules@asdf.us> | 2018-07-18 19:13:04 +0200 |
|---|---|---|
| committer | jules <jules@asdf.us> | 2018-07-18 19:13:04 +0200 |
| commit | 826905abc95f76e16226128ff11e6fa6dafe992d (patch) | |
| tree | ec6719e25d9c3dad5f677bc9ae621b75f5d1eb2a | |
| parent | 9e4edc2158ecf5191862a6f2c6b35bd47ac05c17 (diff) | |
| -rw-r--r-- | .gitignore | 7 | ||||
| -rwxr-xr-x | run_all.sh | 21 | ||||
| -rwxr-xr-x | run_one.sh | 35 | ||||
| -rwxr-xr-x[-rw-r--r--] | stylize_image.sh | 42 | ||||
| -rwxr-xr-x[-rw-r--r--] | stylize_video.sh | 16 |
5 files changed, 93 insertions, 28 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6bac78e --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +\#* +*~ +*.wav +*.png +*.jpg +*.mat + diff --git a/run_all.sh b/run_all.sh new file mode 100755 index 0000000..c2478f5 --- /dev/null +++ b/run_all.sh @@ -0,0 +1,21 @@ +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/fakestyle/fakestyle1.tiff testf01 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/fakestyle/fakestyle2.tiff testf02 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/fakestyle/fakestyle3.tiff testf03 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/fakestyle/fakestyle4.tiff testf04 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/fakestyle/fakestyle5.tiff testf05 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/fakestyle/fakestyle6.tiff testf06 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/fakestyle/fakestyle7.tiff testf07 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/fakestyle/fakestyle8.jpg testf08 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/fakestyle/fakestyle9.jpg testf09 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/fakestyle/fakestyle10.jpg testf10 + +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/original/style1.tiff test01 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/original/style2.tiff test02 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/original/style3.tiff test03 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/original/style4.tiff test04 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/original/style5.tiff test05 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/original/style6.tiff test06 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/original/style7.tiff test07 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/original/style8.tiff test08 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/original/style9.tiff test09 +./run_one.sh ../../data/tokyo_enhance/tokyo_short/thumb1000.jpg ../../Desktop/stylephotos/original/style10.tiff test10 diff --git a/run_one.sh b/run_one.sh new file mode 100755 index 0000000..e325367 --- /dev/null +++ b/run_one.sh @@ -0,0 +1,35 @@ +device='/gpu:0' + +# Parse arguments +content_image="$1" +content_dir=$(dirname "$content_image") +content_filename=$(basename "$content_image") + +style_image="$2" +style_dir=$(dirname "$style_image" ) +style_filename=$(basename "$style_image") + +echo "Rendering stylized image. This may take a while..." +python neural_style.py \ + --content_img "${content_filename}" \ + --content_img_dir "${content_dir}" \ + --style_imgs "${style_filename}" \ + --style_imgs_dir "${style_dir}" \ + --device "${device}" \ + --verbose; + +#mkdir $3_color +#cp image_output/result/* $3_color/ +# +#python neural_style.py \ +# --content_img "${content_filename}" \ +# --content_img_dir "${content_dir}" \ +# --style_imgs "${style_filename}" \ +# --style_imgs_dir "${style_dir}" \ +# --device "${device}" \ +# --original_colors \ +# --verbose; +# +mkdir $3 +cp image_output/result/* $3/ +cp image_output/result/result.png $3.png diff --git a/stylize_image.sh b/stylize_image.sh index 20e4ae9..fe9f707 100644..100755 --- a/stylize_image.sh +++ b/stylize_image.sh @@ -3,27 +3,27 @@ set -e cr=`echo $'\n.'` cr=${cr%.} -if [ "$#" -le 1 ]; then - echo "Usage: bash stylize_image.sh <path_to_content_image> <path_to_style_image>" - exit 1 -fi - -echo "" -read -p "Did you install the required dependencies? [y/n] $cr > " dependencies - -if [ "$dependencies" != "y" ]; then - echo "Error: Requires dependencies: tensorflow, opencv2 (python), scipy" - exit 1; -fi - -echo "" -read -p "Do you have a CUDA enabled GPU? [y/n] $cr > " cuda - -if [ "$cuda" != "y" ]; then - device='/cpu:0' -else +#if [ "$#" -le 1 ]; then +# echo "Usage: bash stylize_image.sh <path_to_content_image> <path_to_style_image>" +# exit 1 +#fi +# +#echo "" +#read -p "Did you install the required dependencies? [y/n] $cr > " dependencies +# +#if [ "$dependencies" != "y" ]; then +# echo "Error: Requires dependencies: tensorflow, opencv2 (python), scipy" +# exit 1; +#fi +# +#echo "" +#read -p "Do you have a CUDA enabled GPU? [y/n] $cr > " cuda +# +#if [ "$cuda" != "y" ]; then +# device='/cpu:0' +#else device='/gpu:0' -fi +#fi # Parse arguments content_image="$1" @@ -41,4 +41,4 @@ python neural_style.py \ --style_imgs "${style_filename}" \ --style_imgs_dir "${style_dir}" \ --device "${device}" \ ---verbose;
\ No newline at end of file +--verbose; diff --git a/stylize_video.sh b/stylize_video.sh index 5f39f89..bc2f8f7 100644..100755 --- a/stylize_video.sh +++ b/stylize_video.sh @@ -1,4 +1,4 @@ -set -e +#set -e # Get a carriage return into `cr` cr=`echo $'\n.'` cr=${cr%.} @@ -72,12 +72,14 @@ cd .. echo "Rendering stylized video frames [CPU & GPU]. This will take a while..." python neural_style.py --video \ ---video_input_dir "${temp_dir}" \ ---style_imgs_dir "${style_dir}" \ ---style_imgs "${style_filename}" \ ---end_frame "${num_frames}" \ ---max_size "${max_size}" \ ---verbose; + --video_input_dir "${temp_dir}" \ + --style_imgs_dir "./" \ + --style_imgs ../../Desktop/stylephotos/fakestyle/fakestyle6.tiff ../../Desktop/stylephotos/original/style5.tiff \ + --style_imgs_weights 0.4 0.6 \ + --end_frame "${num_frames}" \ + --max_size "${max_size}" \ + --verbose; + # Create video from output images. echo "Converting image sequence to video. This should be quick..." |
